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

The sphinx_copybutton extension doesn't properly work out-of-the-box #333

Closed
mgeier opened this issue Oct 7, 2019 · 2 comments · Fixed by #349
Closed

The sphinx_copybutton extension doesn't properly work out-of-the-box #333

mgeier opened this issue Oct 7, 2019 · 2 comments · Fixed by #349

Comments

@mgeier
Copy link
Member

mgeier commented Oct 7, 2019

The extension adds "copy" buttons to all code areas, including Jupyter code cells, see https://github.com/choldgraf/sphinx-copybutton.

Some CSS to work around the issue is shown in #330 (comment), but it would certainly be nice to make this work out-of-the-box.

Currently, there are several problems:

  • the copy buttons are also shown for the prompts, which is quite useless
  • the distance from the top and right edge of the code cell is too large (and much larger than it is in "normal" code blocks)
  • in Chrome, scrollbars appear on code cells with a single line

Firefox:

image

Chrome:

image

@choldgraf
Copy link

Could you give this a shot with the latest sphinx-copybutton and see if it works now? Some recent PRs should have cleaned up the CSS a bit

@mgeier
Copy link
Member Author

mgeier commented Jan 9, 2020

@choldgraf I have just merged #349 with a few fixes on the nbsphinx side of things.

Copy buttons are now enabled in the latest version of the docs: https://nbsphinx.readthedocs.io/en/latest/

I've also re-based all my theme branches to check it on a variety of themes.

It mostly works great!
But there are a few issues: #376

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 a pull request may close this issue.

2 participants