I checked your code, looks like it assign a unique copy to each code block, and use that ID to copy code block to clipboard.
I am wondering, is it possible to just assign a special class to any html element, then your library automatically assign an ID to it, and do the same trick?
If you can implement that, you can define a custom rst:
Then you can use this to allow copy anything to clipboard:
Copy :scb:`This` to clipboard.
How's that sounds?