[Code Copy Button] - A simple plug-in to copy code

Hi everyone,

I’ve created a simple plugin that adds a copy button to code blocks in TiddlyWiki.

Features:

  • Standalone Blocks: Adds a copy button to Pre blocks.
  • Inline Code: Shows a copy button on hover for inline code.

Try it Now

Any feedback is welcome!

4 Likes

I love this! Especially how single-line code blocks have a hover-to-reveal copy code button. Very handy.

My only additional desire as an entitled American (\sarcam, kinda) is to have options for English hover-over tooltips etc; or otherwise refactor it to be language agnostic.

Anyway, I like it a lot! Thanks for putting this together.

-Xyvir

1 Like

Glad you like it! I’ve refactored the plugin to use English by default. Enjoy!

2 Likes

This is amazing! the button also works in all color palettes (dark, warm, and light)
Thank you for sharing.

1 Like

Can I use it with Markdown tiddlers?

1 Like

Your image preview is just fantastic! It’s 24 kB—very affordable. Worth to be announced in a separate post.

1 Like

I don’t think any feedback is necessary. This is a perfect little tool. I’ve had many wikis over the years that could have used this. And first thing Monday morning, I expect to add this to two wikis in progress.

Thank you very much for sharing!

1 Like

This is great and I’m about to add it in!

One thing I noticed was that the only-appears-when-hovering copy button on the inline code, appears when you hover over the area where the button will appears.

To use the example from your own live demo, this means I cannot click on the word “in” after console.log() and begin a selection of text. If that character space was instead a link, it’s rendered unclickable

2026-02-16T21:15:27_ff9b5c1e

I’d suggest either the hover area to make the button appear strictly be the inline code only (till the button appears when obv you need to get to the button!), or the button appear over the code - which is my preference as that matches the block code style too.

Very nice plugin. I wonder if it could be done in pure wikitext, like @vilc’s Copy code button. They are roughly on par, but the Copy Code Button does not have on hover on inline <code> spans (i.e. anything with backticks) like yours does.

1 Like

I just looked at the demo, very nice and superior to my own previous tools, thanks @Byper

Do we need the other plugins on the demo site for full functionality?