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

pygments for coloring source, not just REPL #14344

Open
hydrargyrum opened this issue Feb 17, 2024 · 3 comments
Open

pygments for coloring source, not just REPL #14344

hydrargyrum opened this issue Feb 17, 2024 · 3 comments

Comments

@hydrargyrum
Copy link

c.TerminalInteractiveShell.highlighting_style only affects syntax highlighting of code typed in the prompt

Why doesn't it affect highlighted source code when using ipython's ?? helper which shows the source code of any class/function? That would be very appropriate!

@suzaku
Copy link
Contributor

suzaku commented Feb 21, 2024

I don't think they are implemented in the same way.
For source code shown as part of the result of pinfo, a PyColorize module is used, and you configure it in a different way: c.InteractiveShell.colors = 'Linux'.

https://ipythonbook.com/config/colors.html#:~:text=colors&text=You%20can%20select%20from%20a,you%20hate%20rainbows%20and%20happiness.

@hydrargyrum
Copy link
Author

hydrargyrum commented Feb 21, 2024

you configure it in a different way: c.InteractiveShell.colors = 'Linux'.

I know this :)

I don't think they are implemented in the same way.

But why? Pygments would be appropriate for coloring source shown by ClassName??. It would avoid having to use or even maintain 2 different implementations, would allow to have one color scheme instead of 2, etc.

@suzaku
Copy link
Contributor

suzaku commented Feb 22, 2024

Yes, in theory Pygments can be used to both place.

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

No branches or pull requests

2 participants