Add "Copy to clipboard" button. #37
Conversation
neersighted
left a comment
There was a problem hiding this comment.
Code looks good -- let's just add comments to the SVG files with the license.
|
fyi, |
|
@neersighted added licensing comments to SVGs |
Hi! I am not Abn, but I will try to answer. Biggest issue was that with current setup there was no good plugin for rollup to bundle SVG files with icons for the button. It looked ok on previews, but when we deployed it to production, it broke all JS on our website and that caused a lot of issues. Feel free to work on that feature. |
OK. I have to admit that I am completely novel to hugo and JS, but this might be a nice time to get started (low prio though). Do you have any thoughts on (1) how to proceed and, perhaps more importantly, (2) how to test (and actually fail) before production? |
This code allows for adding the "copy to clipboard" button using Hugo shortcodes. As not every code block needs to be copyable, the button will be added only to parts wrapped in
{{% clipboard %}} ... {{% /clipboard %}}tags. After this is accepted and merged, I will prepare separate PR in the main repo, adding required tags to docs.How to preview
As docs files are not kept with website code, previewing requires some legwork. Checkout this PR, setup the website (as in README) and manually add required tags in downloaded docs files.