jupyterlab/jupyterlab-toc

Skip H1 headers

romainmartinez opened this issue · 8 comments

It is common to start a notebook with a title, like:

# My notebook title

Some information

## My first "real" title

> code

Here, I don't want the title of the notebook to be numbered.

An interesting feature of the ToC 2 extension was to skip the h1 headers in the automatic numbering.

Is it possible to do the same with jupyterlab-toc? If not, is it a feature that could be included in the road map?

Thank you.

mhogg commented

I second this request 👍

I found a little hack. Just avoid putting an h1 tag when you don't want the numbering and replace it with a font tag.

My example would become:

<font size="+2">My notebook title</font>

Some information

# My first "real" title

> code

I agree!

And I'd like to thank the developers to add index function to Jupyter toc!!!

Agreed, excluding some headers from the table of contents would be a very useful feature.

gh4ag commented

In notebooks, using <span><h1></h1></span> used to effectively exclude the header from TOC and TOC numbering. Not anymore since jupyter lab 3.0.

Actually, it still does exclude it when I refresh the entire web page. But it puts the numbers back when I switch notebooks with the jupyter lab interface. Strange...

Any updates?

Is it fine to say that the Jupyterlab PR #9994 merged on 2021-06-22 effectively closes this issue? Or should we wait for a nice UI to set the newly introduced setting numberingH1?

Yes this is indeed close by the mentioned PR. This issue is not updated here anymore as the code for the table of content is now directly in JupyterLab core and does not rely on the code of this repository.

Ah yes. Since I didn't land on the project home page, I didn't see the "Archived" banner in the README. The merge with core JupyterLab is good news for me.