sphinx-copybutton
sphinx-copybutton copied to clipboard
Only copy lines with `.gp` class
Context
I would like to exclude the traceback from being copied:
>>> 1 / 0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ZeroDivisionError: division by zero
But that's difficult because the class of "division by zero" is .n, and hard coding the prompts is prone to error.
Proposal
If a code block contains .gp, allow to exclude .gp from lines and only copy these lines. >>> becomes an empty line.
Or alternatively convert the other lines to empty lines.
Tasks and updates
No response