python-docs-theme icon indicating copy to clipboard operation
python-docs-theme copied to clipboard

Implement copybutton for the shell session

Open serhiy-storchaka opened this issue 5 years ago • 3 comments

Currently the Python session code blocks has a button on top-right corner which hides the >>> and ... prompts and the output.

Would be nice to implement similar button for the shell session code blocks. It should hide the $ prompt and the output.

serhiy-storchaka avatar Dec 12 '19 17:12 serhiy-storchaka

This tutorrial example has one of each. But the command session has only one $ prompt and command. Are there other examples with more?

terryjreedy avatar Dec 13 '19 14:12 terryjreedy

That example only shows the Python prompt as output; there's no issue of there being additional input there. (I haven't looked for other examples.)

That example also mistakenly colorizes the first > of the Python prompt as a shell continuation prompt.

freddrake avatar Dec 13 '19 16:12 freddrake

This exists in the form of a Sphinx extension now: https://github.com/executablebooks/sphinx-copybutton

pradyunsg avatar May 01 '21 10:05 pradyunsg