[Feature] [Docs] Do not copy line numbers when clicking the clipboard
See original GitHub issueSearch before asking
- I had searched in the issues and found no similar feature requirement.
Description
Docs such as this one include code snippets that can be copied by clicking a clipboard pop-up:
However, due to updates in the doc formatting, clicking this clipboard now also copies line numbers (that are inserted using :linenos:
in the source rst documentation files). The requested feature is to allow users to click this clipboard and copy only the code, not the line numbers.
Use case
This feature makes it easier to follow along coding examples in the documentation.
Related issues
No response
Are you willing to submit a PR?
- Yes I am willing to submit a PR!
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Copy to clipboard feature also adding line numbers · Issue #884
This is an issue with the Vitepress alpha version. We have some code blocks with line numbers enabled in markdown. It would appear...
Read more >Copy and paste using the Office Clipboard - Microsoft Support
To open the Clipboard task pane, click Home, and then click the Clipboard dialog box launcher. Double-click the image or text you want...
Read more >How can I avoid copying line numbers to my clipboard from vim?
A better option is to become aware of the registers + (clipboard) and * (primary selection) and make use of them. (See :help...
Read more >Copy and paste text and images - Google Docs Editors Help
You can copy and paste text and images between your files — even if you're going from one type of file to another....
Read more >'containing' line numbers from Find window not copied anymore
All the lines, WITHOUT any line number ·, select the new Copy option ; All the lines, WITH the line numbers ·, hit...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
ok, so surprisingly enough this seems to be a sphinx >= 4.0 issue, which needs to be patched in downstream themes:
https://github.com/sphinx-doc/sphinx/issues/9363
The RTD theme has fixed it, the book theme might not be aware yet:
https://github.com/readthedocs/sphinx_rtd_theme/issues/1168
Hi again! The issue will be closed because there has been no more activity in the 14 days since the last message.
Please feel free to reopen or open a new issue if you’d still like it to be addressed.
Again, you can always ask for help on our discussion forum or Ray’s public slack channel.
Thanks again for opening the issue!