-
Notifications
You must be signed in to change notification settings - Fork 1
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 copy button to code blocks #181
Comments
Should be doable since we can turn our code blocks into React components! The hardest part that comes to mind is making sure we parse the different types of code blocks correctly so that the copied code actually looks right 🤔 |
the biggest question I had thinking about this - should be copy outputs as well: $ dvc plots show
Plots file is ....
# Now run ...
$ dvc plots diff
Some output
what should we copy in this case? |
We could leave this decision up to the writer, which can decide whether to split code and output into 2 separated blocks? |
feel too complicated, will looks a bit ugly I guess ... can be done though, yep |
Would need to be applicable to some CLI blocks specifically indeed. Doesn't sound like an easy implementation. Triple click does the trick too but I'm not sure how many people are aware. |
Can we maybe reprioritize this and simplify? Having guides without this seems lacking No need for fancy logic IMO - we can start with:
It will be possible to expand on that in the future with robust logic to differentiate between the command(s) and outputs. But we can do without it today. |
It would be nice to have a button to copy the entire content of code blocks, like the one supported in GitHub markdown:
The text was updated successfully, but these errors were encountered: