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

Feature: add copy button for code blocks using sphinx-copybutton #76

Merged
merged 2 commits into from
Dec 19, 2022

Conversation

psobolewskiPhD
Copy link
Member

Description

This PR adds the nice copy button to code blocks via sphinx-copybutton
https://github.com/executablebooks/sphinx-copybutton
E.g.
image

I've found these kinds of buttons common in other python docs (e.g. scikit-image)
You can see it at work in a PR to my fork: psobolewskiPhD#5
Here's the built docs artifact: https://github.com/psobolewskiPhD/napari-docs/actions/runs/3725012413

Note that the extension allows for customization such as stripping out prompts, etc. but for now this is just the basics.
https://sphinx-copybutton.readthedocs.io/en/latest/index.html

Type of change

  • Fixes or improves existing content
  • Adds new feature
  • Fixes or improves workflow, documentation build or deployment

References

https://sphinx-copybutton.readthedocs.io/en/latest/index.html

Final checklist:

  • My PR is the minimum possible work for the desired functionality
  • I have commented my code, particularly in hard-to-understand areas
  • I have added alt text to new images included in this PR

@psobolewskiPhD psobolewskiPhD added the enhancement New feature or request label Dec 18, 2022
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Dec 18, 2022
Copy link
Contributor

@brisvag brisvag left a comment

Choose a reason for hiding this comment

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

Love it!

@alisterburt
Copy link
Contributor

❤️

@alisterburt alisterburt merged commit d5308e8 into napari:main Dec 19, 2022
@psobolewskiPhD psobolewskiPhD added this to the 0.4.18 milestone Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants