ASFOpenSARlab / jupyterlab-jupyterbook-navigation

A JupyterLab server extension that provides Jupyter-Book navigation via a sidepanel widget holding a Jupyter-Book table of contents.
BSD 3-Clause "New" or "Revised" License
3 stars 1 forks source link

title detection: title not always in first markdown cell #19

Open parmentelat opened 3 months ago

parmentelat commented 3 months ago

when not provided in the toc, a title is searched from the file's content the code for spotting the title assumes it will be in the first markdown cell however this is not what jupyter book does; I am not sure what the exact behaviour of jb actually is, but I have tons of notebooks where the toplevel title is defined in the 2-nd, 3-rd or even 4-th cell, and so far jb has always picked them properly it would be great to have here the same behaviour as jb

Alex-Lewandowski commented 3 months ago

@parmentelat Thank you for bringing this up, as we do wish to follow Jupyter Book behavior. I agree that the extension should support finding the first level-1 header regardless of the markdown cell in which it appears.

I'll leave this issue open until we add that support.