spatialaudio / nbsphinx

:ledger: Sphinx source parser for Jupyter notebooks
https://nbsphinx.readthedocs.io/
MIT License
450 stars 130 forks source link

Syntax highlighting no longer working with `ipython==8.7.0` #687

Closed nvaytet closed 1 year ago

nvaytet commented 1 year ago

I do not know if the issue lies with nbsphinx or nbconvert, but after upgrading from ipython==8.5.0 to ipython==8.7.0, the syntax highlighting in our sphinx docs is gone. Only black text in the code blocks.

Before: Screenshot at 2022-12-05 10-48-18

After: Screenshot at 2022-12-05 10-51-21

maparent commented 1 year ago

I can confirm that the pygments.lexers entry is no longer added to entry_points.txt. It is because of the explicit

setup_args["entry_points"] = {"console_scripts": find_entry_points()}

at line 142 of setup.py, which should also include the pygments.lexers entry present in setup.cfg

mgeier commented 1 year ago

Thanks @nvaytet for reporting this and @maparent for finding the root cause for the problem.

It looks like the IPython folks are already working on fixing this: https://github.com/ipython/ipython/issues/13845, https://github.com/ipython/ipython/pull/13848.

In the meantime, a possible work-around should be to disallow the broken IPython version:

ipython!=8.7.0
al-jshen commented 1 year ago

Had the same issue here. The old workaround of adding "IPython.sphinxext.ipython_console_highlighting" to "extensions" in conf.py from https://github.com/spatialaudio/nbsphinx/issues/24 seems to fix the problem for me.

mgeier commented 1 year ago

A little update: https://github.com/ipython/ipython/pull/13848 has been merged, now we are only waiting for a new release.

Zethson commented 1 year ago

8.8.0 just got released yesterday

mgeier commented 1 year ago

Thanks @Zethson, I can confirm that syntax highlighting works again with IPython 8.8.