Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demonstration of selecting only commands using Pygments-only #186

Closed

Conversation

rkdarst
Copy link
Collaborator

@rkdarst rkdarst commented Nov 17, 2022

  • 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 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.

rkdarst and others added 2 commits November 17, 2022 17:49
- 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant