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

Copybuttons appear on a new line at the bottom of a cell instead of the top right corner #101

Open
nvaytet opened this issue Nov 6, 2020 · 5 comments
Labels
bug Something isn't working

Comments

@nvaytet
Copy link

nvaytet commented Nov 6, 2020

Describe the bug

Copybuttons appear on a new line at the bottom of a cell instead of the top right corner:
Screenshot at 2020-11-06 15-51-05
I don't know if it is related to the sphinx_rtd_theme.

Also, when I followed the docs to find some info on how to customize the CSS, in this section the following link lead nowhere:
https://github.com/ExecutableBookProject/sphinx-copybutton/blob/master/_static/copybutton.css

Environment

  • Python 3.7.6
  • notebook: 6.0.3
  • sphinx_rtd_theme: 0.5.0
  • Operating System: Ubuntu 20.04
@nvaytet nvaytet added the bug Something isn't working label Nov 6, 2020
@welcome
Copy link

welcome bot commented Nov 6, 2020

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

@choldgraf
Copy link
Member

hmmm - could this be related to some of the SVG changes that @pradyunsg made to the copy icons? This used to show up fine on RTD I believe.

And thanks for pointing out the broken link, fixed now@!

@nvaytet
Copy link
Author

nvaytet commented Nov 6, 2020

I tried the css suggestions in #69 but that did not help

@numero-744
Copy link

numero-744 commented Nov 16, 2022

Same issue here

% cat requirements.txt
sphinx==5.2.0
sphinx-rtd-theme==0.5.2
sphinxcontrib-wavedrom==3.0.2
sphinx-multiversion==0.2.4
sphinx-copybutton==0.5.1

@dlmiles
Copy link

dlmiles commented May 30, 2023

Please read this section: https://docs.readthedocs.io/en/stable/guides/adding-custom-css.html#how-to-add-custom-css-or-javascript-to-sphinx-documentation

Please check your project for anything that looks like this:

html_context = {
    'css_files': [ '_static/my_custom_file.css' ]  ## DO NOT DO THIS, RTDs!
}

Please see if correcting this discrepancy resolves your usage issue. Use of html_context like this is overriding and replacing the internal data model, so any extensions that contributed via app.add_css_file() API have their CSS file contributions lost.

This can be confirmed if you check the output HTML for the lack of copybutton.css that is contributed by this extension at https://github.com/executablebooks/sphinx-copybutton/blob/master/sphinx_copybutton/__init__.py#L92

HTH

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants