forked from executablebooks/sphinx-copybutton
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Demonstration of selecting only commands using Pygments-only
- Remove the prompt regexes and set `copybutton_exclude='.linenos, .gp, .go'`. We get a similar behaviour as before, but with no custom configuration and would (in theory) work with any Pygments-supported language. - This is a demonstration of solution (b) in executablebooks#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 executablebooks#185. This should not be merged.
- Loading branch information
Showing
3 changed files
with
14 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters