nbconvert icon indicating copy to clipboard operation
nbconvert copied to clipboard

Export in html_toc - produces buggy html output

Open stefansimik opened this issue 2 years ago • 6 comments

Hi,

PROBLEM

there is long-term problem, that is is not possible to export notebook in html_toc format in Jupyterlab.

  1. First, there was long-term problem with versions mismatch between jupyter-contrib-nbextensions versus nbconvert
    • see https://github.com/ipython-contrib/jupyter_contrib_nbextensions/issues/1529
  2. and now there is problem with nbconvert itself
  • when exporting in html_toc format, it exports string None, instead of Table of Contents.

SEE PROBLEM OUTPUT

To see the problem, I am attaching both files:

  • input file - test.ipynb
  • output html file - test.html - you can see, there is text None, instead of the Table of Content

Both files in attached zip: test.zip

REPRODUCE

  1. Just install basic python with jupyterlab 3.4.5
  2. plus run 3 lines below:
pip install git+https://github.com/ipython-contrib/jupyter_contrib_nbextensions.git
pip install git+https://github.com/jfbercher/jupyter_latex_envs.git
jupyter contrib nbextension install --user
  1. run Jupyterlab and try export any notebook from menu File / Export notebook / html_toc

LIB VERSIONS

  • Nbconvert version: 6.5.3
  • jupyterlab: 3.4.5
  • jupyter-contrib-nbextensions: 0.6.0

stefansimik avatar Aug 14 '22 10:08 stefansimik

@minrk @jdfreder @Carreau

Could any of you guys please take a look at this?

illtellyoulater avatar Dec 07 '22 13:12 illtellyoulater

I guess you mean the toc2 extension for Jupyter classic, not Jupyterlab ?

The template_path issue with nbextensions has been fixed recently. There is an updated version of jupyter-nbextensions-configurator on PyPi, we are still working on providing an updated conda package.

Unfortunately, the html exported toc depends on files provided by a CDN (https://min.gitcdn.xyz) in the toc2.tpl export template. This seems to be down, making it hard to get the exporter working again.

If there is a replacement for the CDN, it will be easy to fix the toc2 exporter.

juhasch avatar Dec 10 '22 23:12 juhasch

I guess you mean the toc2 extension for Jupyter classic, not Jupyterlab ?

I mean only new modern Jupyterlab (which is started by command: jupyter lab)

  • I am not using the old classic Jupyter (started by command: jupyter notebook) at all.

stefansimik avatar Dec 11 '22 15:12 stefansimik

I'm experiencing this too, and it seems to be across the community.

Many solutions recommend pip install "nbconvert<6", but the responses have said that the downgrade is impossible which has been my experience trying to get this to work.

Jordanbarker avatar Jun 23 '23 22:06 Jordanbarker

Is there any development on the problem? It seams there is no way to convert to html with toc with nbconvert>=6?

HristoRaykov avatar Nov 09 '23 13:11 HristoRaykov

Looks like nobody can solve it. It is a long-term issue. I started using quarto.org for exporting notebooks and it is really excellent - much better than original HTML_TOC.

stefansimik avatar Nov 09 '23 19:11 stefansimik