CopyButton.js is a util for making copy buttons in your <pre><code> code blocks. It has a lot of configuration, and best of all, you don’t need to write a single line of js to use it.
Although water.css is not required, the util was built with it in mind, so you might want to use that too.
After that, any <pre><code class="docopy"> will have a copy button.
It was mainly so I could use the same highlighting, and use the user’s theme, but it seems like Replit doesn’t use the normal js mode (and probably other ones too). So yeah I might change it back
Update: now has a global api (whole page) with the data-no-update attribute and the updateCopybutton() function. The data-copybutton-automatic-seen will be now be added to all code blocks that got applied a copybutton too.