ipython-contrib / jupyter_contrib_nbextensions

A collection of various notebook extensions for Jupyter
http://jupyter-contrib-nbextensions.readthedocs.io/en/latest
Other
5.2k stars 806 forks source link

toc2: Headers written in HTML do not show in HTML export #1538

Open Alcampopiano opened 3 years ago

Alcampopiano commented 3 years ago

Hello,

Thanks so much for toc2!

In my notebook, some of my headers are written in HTML. For example,

sctoc

Here you can see that the running notebook's ToC recognizes the HTML.

However, when I export to HTML using nbconvert as follows:

jupyter nbconvert my_notebook.ipynb --to html_toc --no-input

The exported notebook does not see the headers that were given as HTML. For example:

sctoc_no

Is anyone able to point me in the right direction here (I assume I'm doing something incorrectly).

Al

e-dorigatti commented 2 years ago

You need to give an unique id to your header, i.e.,

<h1 id="header1" style="text-align:center;">ENVIRONMENTAL SCAN</h1>