executablebooks / sphinx-copybutton

Add a "copy" button to code blocks in Sphinx
https://sphinx-copybutton.readthedocs.io/en/latest/
MIT License
249 stars 50 forks source link

Using with read_the_docs template #11

Closed ijaureguialzo closed 5 years ago

ijaureguialzo commented 5 years ago

Hello, I'm trying to use it with this template and get a green square (not gray) and a tiny icon.

How can I properly customize it? I've looked into the css file and there's no green background anywhere. Tried in Safari and Chrome, same results.

This is what I get:

grabacion de pantalla 2018-10-31 a las 12 19 36

choldgraf commented 5 years ago

huh, that is super weird. Do you have a live site somewhere online?

ijaureguialzo commented 5 years ago

Hello, you can see it live here:

https://lm-xml-apuntes.readthedocs.io/es/copybutton_test/apuntes/20_sintaxis_xml.html

The source which is used for the build is in this repository, on it's own copybutton_test branch:

https://github.com/Egibide-DAM/lm-xml-apuntes/tree/copybutton_test

choldgraf commented 5 years ago

great - thanks for the link, I'll try and figure this one out this week! If you come up with a solution of your own, please don't hesitate to share and we can incorporate it into the extension!

choldgraf commented 5 years ago

hey - I think that this should be fixed in #16...can you try installing sphinx_copybutton from master and seeing if that fixes things? You might still need to tweak some CSS but the green weirdness should be gone...

ijaureguialzo commented 5 years ago

Great, thank you!

It's working correctly now, no green background and the icon looks good:

https://lm-xml-apuntes.readthedocs.io/es/copybutton_test/apuntes/20_sintaxis_xml.html#

BTW: I'm new to this thing of pip extensions and don't know how are they released; how do I now when it's released in production and can stop using the direct reference to the GitHub branch?

choldgraf commented 5 years ago

you'd need to update whenever sphinx-copybutton cuts a new release.......which I'll do now, so you can start using the non-github version in about 5 minutes :-)

choldgraf commented 5 years ago

ok, should be released - give it a shot and see if that works!

ijaureguialzo commented 5 years ago

The release version is working perfectly.

Thanks!

wtbarnes commented 4 years ago

I'm using the latest PyPI release (v0.2.5) with the RTD theme and I'm still seeing this behavior. The icon is small, but without the green box. Any chance this problem has crept back in?

ijaureguialzo commented 4 years ago

The icon seems good, only a bit small.

I customized my css and added a 1.4em width and height to the link and now it looks much better. Maybe this could be opened as a PR to be included in the main css file.

Here's the source (changes are in last commit): https://github.com/egibide-dam/lm-xml-apuntes

And the generated docs where the button is used: https://lm-xml-apuntes.readthedocs.io/apuntes/20_sintaxis_xml.html

Hope it helps.

choldgraf commented 4 years ago

if folks think there's a fix that could be made in this repo that is more consistent across themes etc, let me know and I'm happy to review PRs!