Skip to content

Conversation

@choldgraf
Copy link
Member

@choldgraf choldgraf commented Feb 3, 2022

Description

This PR modifies the way that we insert copy buttons into the code blocks, so that we directly insert the SVG into the DOM, rather than linking to one via the <img> tag. This allows users to style the color of the copy button icon, which is particularly useful for things like "dark mode".

try it out here 👉 https://readthedocs.org/projects/sphinx-copybutton/builds/15979421/

For example, here's the copy button's current behavior with Furo:

chrome_67VenlcCei

And the new behavior:

chrome_c6hygwMify

Modifying the copy icon now means directly pasting in some SVG code to your conf.py file, rather than specifying a path to an image file. This old copybutton_image_path will go through a deprecation cycle.

@choldgraf choldgraf changed the title Directly add SVG instead of linking via IMG ENH: Directly add SVG instead of linking via IMG Feb 6, 2022
@choldgraf choldgraf merged commit 915aa4c into executablebooks:master Feb 6, 2022
@choldgraf choldgraf deleted the doc-update-docs branch February 6, 2022 01:23
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 this pull request may close these issues.

1 participant