2

I have a readthedocs sphinx documentation which uses nbsphinx to display jupyter notebooks. When I build the documentation locally with autobuild, I have syntax highlighting in the code cells in the jupyter notebook. But on readthedocs, the code cells don't have any syntax highlighting.

Is there something I have to activate to get syntax highlighting in these cells?

Randrian
  • 1,055
  • 12
  • 25
  • See https://nbsphinx.readthedocs.io/en/0.6.0/installation.html#Pygments-Lexer-for-Syntax-Highlighting – Matthias Apr 13 '20 at 09:02

1 Answers1

4

I had the same problem and managed to fix it by reading through the contents in the link to the documentation that was posted in the comments to the question.

The easiest way to fix this is including 'IPython' in the pip requirements file that RTD uses to build your documentation (usually, 'requirements.txt' in the project root directory).

LuizFelippe
  • 172
  • 9