-
I am curious to know how can I have click to copy button on the top right corner, using the You can see an example here https://docs.pyrogram.org/ |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
I'm assuming that is using a newer version of the theme. Out clone of the theme is based on an older version. We would need to update the theme to the newer version. Although, that may not matter. Click to copy is generally a feature of a syntax highlighter and if we are using a different one, things may not work the same. However, that would require some investigation to determine how it is implemented there. |
Beta Was this translation helpful? Give feedback.
-
Material for MkDocs - a popular theme - integrates with Clipboard.js and supports this functionality out-of-the-box 😊 You can check the implementation - it’s easy to add with some extra JS! |
Beta Was this translation helpful? Give feedback.
-
Material for mkdocs is a cool theme, and many modern projects use it. But I am still attracted to the old readthedocs theme. How can I add the copy to clipboard feature there ?
How can I do this ? Can you please give link to relevant docs, so that I can learn about changing the theme ? It would be great if mkdocs provides "copy to clipboard" for readthedocs theme, out of the box. thank you. |
Beta Was this translation helpful? Give feedback.
-
I accomplished this as follows:
|
Beta Was this translation helpful? Give feedback.
I accomplished this as follows:
tippy-bundle.umd.js
andpopper.min.js
) into ajs
subfolder.css/extra.css
which styles the copy-to-clipboard button:js/extra.js
which uses jQuery (built into the theme) to wait for the page to load and then find allcode
blocks, insert a Copy button, and add handlers: