website
website copied to clipboard
add copy to clipboard functionality
This adds the copy to clipboard feature that is available on many documentation websites. It sits inline with the text, so there wont be any cases where it will overlap existing content.
Clicking the copy button takes the contents inside the code block and copies it to your clipboard, you receive a tooltip when clicking it that disappears after a second. I'm open to tweaking the timing on the tooltip if it feels slow.
Hmm, this had some side-effects on /docs/install. For example, the Debian section's commands have a lot more padding now.
Before:
After:
Also I'm only seeing the copy button on some of the blocks on this page. I'm not sure why though, they aren't significantly different other than missing the button :thinking: Probably just a selector bug.
Hmm, this had some side-effects on
/docs/install. For example, the Debian section's commands have a lot more padding now.Before:
After:
Also I'm only seeing the copy button on some of the blocks on this page. I'm not sure why though, they aren't significantly different other than missing the button 🤔 Probably just a selector bug.
@francislavoie I'm seeing the same thing, I've added some changes to fix that in other locations. I think a better fix for this is for any case where there is a code element along with more than one span, is to add an inner div, keep the cmd's within that inner element along with some padding. Then absolutely position the copy button outside of that code block, which will ensure it wont overlap any text. I wont have a chance to update this PR with thos fixes until late afternoon today if that is alright?
No rush at all 👍 take your time
Yeah, thanks for working on that! No problem, we're not in a hurry :)
Is this ready to merge? If not, feel free whenever it's ready :)

