jupyter-book
jupyter-book copied to clipboard
TOC title ignored for first page
Describe the bug
The documentation states that the title key overrides the automatic title (https://jupyterbook.org/customize/toc.html#specifying-alternate-titles). However, the title key does not work for the first page in the TOC. For example, in the screenshot below I want the first page in the TOC to have the title "Introduction" but keep the main title of the page as-is.
To Reproduce
Steps to reproduce the behavior:
Add this intro.md file:
# Principles and Techniques of Data Science
test
In _toc.yml:
- file: intro
title: Introduction
Expected behavior
First entry of the generated TOC in the sidebar should be "Introduction", not "Principles and Techniques of Data Science".
Environment
- Python Version [e.g. 3.7.1]: 3.8.3
- Package versions or output of
jupyter-book --version: 0.8.2 - Operating System: macOS
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:
ah, that's a good catch! this is because we're special-casing the first page here: https://github.com/executablebooks/sphinx-book-theme/blob/master/sphinx_book_theme/init.py#L123
that's where we'd need to add a check for whether title has been given for that page in _toc.yml and update the output accordingly