xy2z / PineDocs

A fast and lightweight site for viewing files
GNU General Public License v3.0
141 stars 19 forks source link

Add a "copy" function for each code block #155

Closed xy2z closed 2 years ago

xy2z commented 3 years ago

For each code block (<pre><code>) there should be added a "copy" icon in the top right position. When you click the icon, it should copy the content of the code block. Should also include a tooltip that says "Copy" on hover and then "Copied!" on click.

It should work exactly like this page: https://www.ngxs.io/recipes/authentication

image

Please use SVG for the icon

Mylloon commented 2 years ago

There is highlightjs-copy, it's possible to do it this way