jupyter-book
jupyter-book copied to clipboard
Title in `_toc.yml` and page metadata does not over-ride page titles
Describe the bug
When I type:
- file: notebooks/asdf_example/asdf_example.ipynb title: ASDF Example
The result pulls from the title of the notebook instead. Where the notebook is located: https://github.com/spacetelescope/jdat_notebooks/blob/main/notebooks/asdf_example/asdf_example.ipynb
I expect the sidebar to read: "ASD Example"
Picture attached. Entire repo here: https://github.com/spacetelescope/jdat_notebook
![Screen Shot 2022-04-27 at 2 34 37 PM](https://user-images.githubusercontent.com/5994975/165595911-4bd8fb58-cf41-473a-b2c1-ca6c7020213b.png)
Reproduce the bug
The result pulls from the title of the notebook instead. Where the notebook is located: https://github.com/spacetelescope/jdat_notebooks/blob/main/notebooks/asdf_example/asdf_example.ipynb
List your environment
jupyter-book 0.12.3
Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:
thanks for reporting this @orifox
Just to clarify in your _config.yml
do you have something like:
format: jb-book
root: index
chapters:
- file: path/to/chapter1
title: <some title>
where title:
is on its own line, but indented as part of the - file:
group?
https://jupyterbook.org/en/stable/structure/configure.html#specify-alternate-titles
Yes, correct. It didn't format correctly above. It looks like this:
format: jb-book
root: intro
parts:
- caption: Cross-Instrument
chapters:
- file: notebooks/asdf_example/asdf_example.ipynb
title: ASDF Example
For the record, I'm able to reproduce this issue in a "real" jupyterbook, but not in a simple jupyterbook (gotten from creating jb create test
.
I'll keep trying to debug it, I suspect I have to cleanup all of the notebook files to resolve all the errors that are similar to:
WARNING: Non-consecutive header level increase; 1 to 3 [myst.header]
I suspect those errors are causing this unintended effect.
Reminder: when debugging this, I've just remembered that it's worth it to wipe the _build
directory and regenerate it: jb build .
Update: the incorrect behaviour is gone once the Non-consecutive header level increase;
warnings are dealt with. IMHO, those probably need to be errors instead of warnings, but I can see how that would be incredibly disruptive.
Perhaps a workaround could be to make the warning more specific: in addition to what's there, add "your table of content may behave in unexpected ways if these warnings are not resolved"
Yep, confirmed. That's exactly the problem. Thanks.