Demonstration of selecting only commands using Pygments-only #186
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Remove the prompt regexes and set
copybutton_exclude='.linenos, .gp, .go'
. We get a similar behaviour as before, but with nocustom configuration and would (in theory) work with any
Pygments-supported language.
This is a demonstration of solution (b) in Conflict between regex exclusion/prompt selection and copybutton_exclude #185. We don't define
prompt or output regexes, but let Pygments lex it and give it css
classes. Here, we exclude Generic.Prompt and Generic.Output
classes.
The formatCopyText function had to be adjusted, since the "remove
blank lines" only worked if the prompt detection was on. This
re-ordering enables it all the time, which isn't great, since it can
remove other meaningful blank lines. It needs to be thought out
better.
The IPython and bash lexers are changed to their respective console
lexers.
Here documents don't seem to work. Pygments could be improved to
support this better.
Further discussion is in Conflict between regex exclusion/prompt selection and copybutton_exclude #185. This should not be merged.