alabaster
alabaster copied to clipboard
clipboard.js integration
Would you be interested in a clipboard.js integration?
A small "copy to clipboard" button on code blocks (literalinclude and code-block directives)
the hackish way is to inject the .js in the theme and plug it on the block css
the clean way is probably to create a new directive based on https://github.com/sphinx-doc/sphinx/blob/master/sphinx/directives/code.py#L373 and https://github.com/sphinx-doc/sphinx/blob/master/sphinx/directives/code.py#L97 , so we can control which block gets a button, but then it's not backward compatible
I personally think this would be great! Would be interested in hearing others thoughts, though.
https://clipboardjs.com/
I think this would be neat but it'd be predicated on the usual concerns - e.g. not disruptive or frustrating for users who don't want it, and easy to configure.
I assume default would be off, and it'd be an html_option boolean.