You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I am following through the Django project tutorial in the official Django website there are so many commands like below, so adding a click to copy text would be a time saver.
It seems some code blocks already have this feature (clipboard.js). Perhaps we can just utilize that but I like the style of the Sphinx copy button for 1 line commands.
I'd be willing to work on this if it's still open.
sphinx-copybutton also uses clipboard.js - so I guess it's a matter of avoiding loading the same JS library twice if its included through the Sphinx extension. If the copy of the JS library included in sphinx-copybutton can be used for the Django project (or the other way around), then we can also avoid having the same asset from different sources and with different versions. But other than that, seems like it's possible to use the same styles, HTML elements and JS library on the entire website, as well as isolated Sphinx documentation builds 👍
@Yadnyesh-Dashpute you don't need to be assigned. People can see now that you will be working on this so go ahead and raise a PR when you have something to look at 👍
If you find something you'd like to work on, just go ahead and work on it - there's no need to ask. Though it's worth looking to see if anybody has mentioned that they might be working on it or if there are linked PRs. Quite often someone might say they're going to look at something, but unless there's a PR we don't really know the status of that, so bare in mind how long it has been since someone talked about working on something.
Hello sir. I'm very new in opensource coding.. but I think I can resolve this problem . but I'm confused from which file is this issue is related to ?? would you please guide me ??
The code provided is for adding a [Click to copy]functionality. When users click the "Click to copy" button next to a command or piece of text, the text is automatically copied to their clipboard.
Activity
himanshu007-creator commentedon Nov 24, 2022
I would like to work on that issue
carltongibson commentedon Nov 24, 2022
There's a Sphinx copy button extension: https://sphinx-copybutton.readthedocs.io/en/latest/ — looking into adapting that would be good.
The docs aren't raw sphinx HTML. We use the JSON builder, and then insert the body into a Django template.
VenkataBhaskarr commentedon Nov 26, 2022
yes if we used Sphinx copy button extension the ouputs are as follows
I have added
sphinx_copybutton
in extensions in conf.py file in docs folder.BEFORE :
AFTER :
Maniktherana commentedon Jan 23, 2023
It seems some code blocks already have this feature (clipboard.js). Perhaps we can just utilize that but I like the style of the Sphinx copy button for 1 line commands.
I'd be willing to work on this if it's still open.
ghost commentedon Apr 4, 2023
benjaoming commentedon Jul 21, 2023
sphinx-copybutton also uses clipboard.js - so I guess it's a matter of avoiding loading the same JS library twice if its included through the Sphinx extension. If the copy of the JS library included in
sphinx-copybutton
can be used for the Django project (or the other way around), then we can also avoid having the same asset from different sources and with different versions. But other than that, seems like it's possible to use the same styles, HTML elements and JS library on the entire website, as well as isolated Sphinx documentation builds 👍rabahalishah commentedon Aug 13, 2023
I would like to contribute to this.
sabderemane commentedon Aug 24, 2023
@rabahalishah feel free to work on this, no need to be assigned to work on an issue :)
marksweb commentedon Sep 21, 2023
There's a class of
code-block-caption
which adds the styling and the copy button, but the JS doesn't appear to be loaded by default.This class and
snippet
are hooked up toclippify
, but they don't appear to be in use anywhere at the moment.https://github.com/django/djangoproject.com/blob/main/djangoproject/static/js/main.js#L101
Yadnyesh-Dashpute commentedon Oct 31, 2023
@VenkataBhaskarr Please Assign Me This Issue. I Want To Work On this Issue.
marksweb commentedon Oct 31, 2023
@Yadnyesh-Dashpute you don't need to be assigned. People can see now that you will be working on this so go ahead and raise a PR when you have something to look at 👍
Yadnyesh-Dashpute commentedon Oct 31, 2023
@marksweb Okay
Fix django#1276: Add copy to clipboard for commands
Om15102003 commentedon Dec 6, 2023
I would like to work on this issue.
marksweb commentedon Dec 6, 2023
@Om15102003 There's already an open PR for this here; #1434
If you find something you'd like to work on, just go ahead and work on it - there's no need to ask. Though it's worth looking to see if anybody has mentioned that they might be working on it or if there are linked PRs. Quite often someone might say they're going to look at something, but unless there's a PR we don't really know the status of that, so bare in mind how long it has been since someone talked about working on something.
Fix django#1276: Add copy to clipboard for commands
Fixed django#1276 -- Added copy buttons to console and shell commands.
Fixed django#1276 -- Added copy buttons to console and shell commands.
Fix django#1276: Add copy to clipboard for commands
Fareed95 commentedon Dec 13, 2023
Hello sir. I'm very new in opensource coding.. but I think I can resolve this problem . but I'm confused from which file is this issue is related to ?? would you please guide me ??
varshithreddy7 commentedon Jun 4, 2024
I will like to contribute this issue
08preeti commentedon Sep 4, 2024
The code provided is for adding a [Click to copy]functionality. When users click the "Click to copy" button next to a command or piece of text, the text is automatically copied to their clipboard.
<title>Click to Copy Example</title> <style> .command-container { position: relative; display: inline-block; margin-top: 10px; } .copy-button { position: absolute; top: 0; right: 0; padding: 5px; cursor: pointer; background-color: #f3f3f3; border: 1px solid #ccc; border-radius: 3px; } </style>Example Django Command
parthhhgohel commentedon Dec 13, 2024
I have solution of this issue
divya5-11-04 commentedon Jan 1, 2025
clippify.js
#1968