You need to sign in or sign up before continuing.
Quickly copy code blocks in the Content Editor
Problem to solve
Code blocks (content fenced by ```) in Markdown are often used to share multiple lines of code in documentation. In these scenarios, it's expected that someone reading the content might want to copy that code to their clipboard for use in their IDE. This currently requires the viewer to highlight the text. Spacing can be important so if you're not precise with your selection, the code copied to your clipboard may not work.
There's got to be a better way!
Proposal
Extend the functionality of rendered code blocks in the Content Editor to include a copy button on every one. This button should copy the entire content of the code block to the local clipboard.
Details
Open questions
- In order to reduce visual clutter, maybe this button only appears when the cursor is hovering over a code block? Will this make it too hard to discover?
Edited by Eric Schurter