Sidebar has issues pass second level
So I've tried to make a sidebar on a project that has more then a single level (i.e. folder structure as project/nbs/one/two) and experiencing issue where the second level files are not grouped together, as shown here:
sidebar:
contents:
- index.ipynb
- 00_core.ipynb
- section: a
contents:
- a/one.ipynb
- a/two.ipynb
- section: b
contents:
- a/b/four.ipynb
- section: a
contents:
- section: b
contents:
- a/b/three.ipynb
The older version (2.0.7) works ok, and produces correct result:
sidebar:
contents:
- index.ipynb
- 00_core.ipynb
- README.md
- section: a
contents:
- a/one.ipynb
- a/two.ipynb
- section: b
contents:
- a/b/four.ipynb
- a/b/three.ipynb
Looks like this PR solved the issue https://github.com/fastai/nbdev/issues/922 but introduced this one.
Facing similar issue here, had to enable custom_sidebar and edit _quarto.yaml or sidebar.yaml manually to navigate this problem.
For anyone facing this problem, workaround is to edit their own nbs/_quarto.yaml using this structure.
https://github.com/fastai/nbdev/blob/923f2b010b5079642b84baa68688b745a4db40d8/nbs/_quarto.yml#L18-L27
For multi-level, just repeat the top-level structure:
sidebar:
style: floating
contents:
- auto: "/*.ipynb"
- section: "core"
contents:
- auto: "core/*"
- section: "utils"
contents: "core/utils/*"
Set custom_sidebar, remove sidebar.yaml and you are good to go.
https://github.com/fastai/nbdev/blob/923f2b010b5079642b84baa68688b745a4db40d8/nbs/_quarto.yml#L58
This should be documented if nbdev is not going to support multi-level project out-of-the-box.
However, this will make the top-level section index.(ipynb|qmd|html) hyperlink not included. This is normal quarto behavior Quarto's documentation: Website .
In which you can just use an href option to manually assign the index page.
. . .
- section: your_section
href: path/to/index
. . .