jupyter/jupyter-sphinx

Thebelab directive: Code highlighting not working properly?

martinRenou opened this issue · 2 comments

When using the Thebelab button to make the code cells executable, I don't seem to be able to have syntax highlighting working properly.

thebe.mp4

I tried with a dev install (master branch) of jupyter-sphinx, and it seems that data-language is being set to "ipython" here:

return '<div class="{}" data-executable="true" data-language="{}">'.format(
This seems to be wrong and should be just "python", but even trying "python" locally does not work for me.

Do you have any pointers to how I could fix this? Could this be a Thebelab issue?


On another note, it looks like the font size changes when making the cells executable?

I just realized there was a sphinx-thebe, where they seem to set the language to Python like this: https://github.com/executablebooks/sphinx-thebe/blob/master/sphinx_thebe/__init__.py#L109-L110

I was able to get sphinx-thebe to work nicely with jupyter-sphinx, I commented on #165 as it's going more in the direction of replacing the current thebe extension from jupyter-sphinx