-
-
Notifications
You must be signed in to change notification settings - Fork 59
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
Proposal to add copy button to code examples [copy of gh-107024] #154
Comments
We'd probably want to evaluate what exists in the literature thus far; it might be that the copybutton.js that I rewrote is redundant. It functions to hide certain Pygments classes denoting output from interactive console display blocks. Should we decide to add a "click to copy" button, I think the functionality should be merged with the existing button. A |
May I ask you, what do you mean by "We'd probably want to evaluate what exists in the literature thus far;"? :) |
E.g. https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Interact_with_the_clipboard; https://clipboardjs.com/ -- there are many ways to and libraries for interacting with the clipboard -- ought we abandon our JavaScript, ought we adopt a pre-existing library, ought we use the browser APIs, etc. A |
FYI, there's also a pre-made (Which, btw, can):
Full docs: https://sphinx-copybutton.readthedocs.io/ |
Hi!
I'm planning to move this work to this repo.
@AA-Turner Suggested to me in this PR python/cpython#107037 (comment) to do that. Please tell me, what do you think :)
Do you agree that that's a good idea?
If so, I guess I would need to rewrite this function, right?
https://github.com/python/python-docs-theme/blob/main/python_docs_theme/static/copybutton.js
The text was updated successfully, but these errors were encountered: