-
Notifications
You must be signed in to change notification settings - Fork 321
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
Exclude copy button from notebook cell numbers #1811
Exclude copy button from notebook cell numbers #1811
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!!!! This looks good 🚀
As I was about to merge, I thought, that since the change is in docs/conf.py (our documentation site configuration file this will only fix the issue for our docs. Shall we add a note in our docs aimed at users so they know that if they are using notebooks to generate content like this they have to add this configuration to their own |
Oh, that's a good catch. Will need to give this a rethink |
In the short term, I decided to add a note to the docs for end users. For the longer term, I will look into filing an issue or pull request with nbsphinx. For our end users, the ideal situation is for things to "just work" so they don't have to do extra config to make nbsphinx and Sphinx-copybutton play nicely together. |
Agree! I think this short-term fix should suffice for now but ideally this will be something that just works for users long-term |
* Exclude copy button from notebook cell numbers * Update docs/conf.py * Add note in docs about Sphinx-copybutton and nbsphinx
Because of the way nbsphinx renders notebook cells and the way that Sphinx-copybutton targets code blocks, the line numbers next to notebook cells were getting the copy button, as the following screenshot shows:
This PR changes the copy button selector to exclude the notebook cell line numbers.
Note: the default copy button selector is
div.highlight pre