-
-
Notifications
You must be signed in to change notification settings - Fork 954
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
Add Click to copy text for commands present in the official Django website. #1276
Comments
I would like to work on that issue |
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. |
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 |
I would like to contribute to this. |
@rabahalishah feel free to work on this, no need to be assigned to work on an issue :) |
There's a class of This class and https://github.com/django/djangoproject.com/blob/main/djangoproject/static/js/main.js#L101 |
@VenkataBhaskarr Please Assign Me This Issue. I Want To Work On this Issue. |
@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 👍 |
@marksweb Okay |
I would like to work on this issue. |
@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: code copying logic
Fix: code copying logic
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 ?? |
I will like to contribute this issue |
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
|
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.
Before :
After :
The text was updated successfully, but these errors were encountered: