sphinx-copybutton icon indicating copy to clipboard operation
sphinx-copybutton copied to clipboard

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

Open nvaytet opened this issue 5 years ago • 5 comments

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 avatar Nov 06 '20 14:11 nvaytet

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
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! :tada:

welcome[bot] avatar Nov 06 '20 14:11 welcome[bot]

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@!

choldgraf avatar Nov 06 '20 15:11 choldgraf

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

nvaytet avatar Nov 06 '20 15:11 nvaytet

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

numero-744 avatar Nov 16 '22 20:11 numero-744

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

dlmiles avatar May 30 '23 23:05 dlmiles