jupyterlab/jupyterlab-toc

Keep numbered header when exporting

marctorsoc opened this issue · 3 comments

Being this my first contribution to this repo, I first would really like to show appreciation for this extension. I really love it and use it.

Something I use everyday is the option to show numbered headers based on whether you define #, ##, ###, etc. However, the numbers are not shown when exporting to e.g. HTML? Is this something difficult to implement? I'm not front-end, but with some guidance I can take a look :)

Thanks

Good idea,
I just want to point out, that permanent switch to displayin numbers can
lead to exactly opposite problem, where other people for other cases,
would prefer to not display numbers.

Expectation to show numbers in headers is different case by case.

I like the idea - can be definitely useful and it should be configurable somehow:

  • maybe from UI which can be harder
  • or via some preferences in Settings.

agree, as another option, we might add some indication when adding a header (#), say #n or something, so that the HTML exporter understands we want numbers? Not sure this is feasible as no idea how it internally works

Again, thanks for this beautiful extension.
If I understand correctly, this exists in toc2, the extension for Jupyter: https://jupyter-contrib-nbextensions.readthedocs.io/en/latest/nbextensions/toc2/README.html and it used an additional export option "Export as html_toc"
Would it be easy to implement?