dvc.org
dvc.org copied to clipboard
Add copy button to code blocks
It would be nice to have a button to copy the entire content of code blocks, like the one supported in GitHub markdown:
pip install dvclive
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?
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?
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.