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

Fix python syntax highlighting in remote readthedocs build, in notebooks #103

Closed
drbenvincent opened this issue Dec 1, 2022 · 3 comments
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@drbenvincent
Copy link
Collaborator

drbenvincent commented Dec 1, 2022

We used to get appropriate syntax highlighting of Python code in both local and remote builds of the docs. And that went for .rst, .md, and .ipynb files.

Currently I still get good syntax highlighting locally.

But the problem is that syntax highlighting has broken just for ipynb files and just in the remote readthedocs build.

Example of correctness in local docs build

Screenshot 2022-12-01 at 18 54 33

Example of incorrect syntax highlighting in remote readthedocs build

Screenshot 2022-12-01 at 18 57 01

Warning

The relevant warning in the logs of the remote readthedocs build is:

WARNING: Pygments lexer name 'ipython3' is not known
@drbenvincent drbenvincent added bug Something isn't working documentation Improvements or additions to documentation labels Dec 1, 2022
@drbenvincent
Copy link
Collaborator Author

Note, adding ["IPython.sphinxext.ipython_console_highlighting", "IPython.sphinxext.ipython_directive"] to the extensions list in conf.py is not an acceptable solution. It gives the ugly lime green fill colour of the code cells

@drbenvincent
Copy link
Collaborator Author

It looks like this might be an ipython issue scikit-hep/pyhf#2067

@drbenvincent
Copy link
Collaborator Author

This did fix the problem. Fingers crossed it will be resolved in 8.7.1. If not, this might reappear, in which case this problem will reemerge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant