Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FLASH PR: Sphinx Code Snippets Copy Extension #2198

Merged
merged 1 commit into from
May 8, 2024
Merged

Conversation

JackEAllen
Copy link
Collaborator

@JackEAllen JackEAllen commented May 8, 2024

Add Sphinx-copybutton extension to allow for easy copying of code snippets

Issue

Flash PR

Description

Currently we, don't have a code snippet copy button. This PR adds the extension: sphinx-copybutton to the project to add such a button (see screenshot below)

image

  • Add sphinx-copybutton dependency to environment-dev
  • Add sphinx-copybutton to list of sphinx extensions within conf.py

Testing

Describe the tests that were used to verify your changes.

  • Rebuild docs and check that code snippets not have a copy button on mouse hover

Rebuild docs: rm -rf docs/build; make build-docs
Run docs: python -m http.server from/mantidimaging/docs/build/html

Acceptance Criteria

How should the reviewer test your changes?

  • Code snippets now have a copy code button on mouse hover

Documentation

N/A

Add Sphinx-copybutton extension to allow for easy copying of code snippets
@JackEAllen JackEAllen self-assigned this May 8, 2024
@JackEAllen JackEAllen marked this pull request as ready for review May 8, 2024 13:44
@coveralls
Copy link

Coverage Status

coverage: 72.796%. remained the same
when pulling 76d4a87 on sphinx_code_copy
into aa73fc2 on main.

Copy link
Collaborator

@samtygier-stfc samtygier-stfc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's handy :-)

@samtygier-stfc samtygier-stfc added this pull request to the merge queue May 8, 2024
Merged via the queue into main with commit ccc3273 May 8, 2024
8 checks passed
@samtygier-stfc samtygier-stfc deleted the sphinx_code_copy branch May 8, 2024 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants