sphinx-copybutton icon indicating copy to clipboard operation
sphinx-copybutton copied to clipboard

Thoughts on dropping the dependency on clipboard.js?

Open pradyunsg opened this issue 3 years ago • 3 comments

Is your feature request related to a problem? Please describe.

https://www.npmjs.com/package/clipboard-js -- clipboard.js is a deprecated package, and all the relevant APIs are available as vanilla JS in modern browsers.

Describe the solution you'd like

See https://tomspencer.dev/blog/2018/09/14/adding-click-to-copy-buttons-to-a-hugo-powered-blog/#final-code, which describes the entirety of what JS is needed to cleanly implement the same functionality on modern browsers.

Describe alternatives you've considered

Status quo? IDK any good alternatives to be honest.

Additional context

Nothing. I just realized that all Sphinx extensions that I generally recommend, are all now projects under the executablebooks umbrella. :)

pradyunsg avatar Sep 21 '20 15:09 pradyunsg

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

welcome[bot] avatar Sep 21 '20 15:09 welcome[bot]

I'm totally fine with it as long as the behavior stays the same. I used clipboard.js originally just because I'm not a JS developer and that was the fastest path towards getting a working functionality :-)

choldgraf avatar Sep 21 '20 17:09 choldgraf

https://github.com/executablebooks/sphinx-copybutton/pull/206 should address this.

nijel avatar Apr 14 '23 13:04 nijel