Jupyter Book Duplicate ToC
This package allows a Jupyter Book _toc.yml file to list the same document file more than once.
It installs a small sitecustomize hook so the normal jupyter-book command uses the patched parser during its early TOC validation. It also provides jupyter_book_duplicate_toc.sphinx for the later Sphinx parse.
The patch keeps the first parsed document entry. Later TOC entries point to that same document as leaf links, so repeated chapter or root pages do not expand their original child tree.
Use standard Jupyter Book file-entry syntax when naming a repeated page:
- file: intro.md
title: Welcome!
The caption key belongs on TOC groups, not on file entries. This package raises an error if a repeated file entry uses caption, with a suggestion to use title.
Install
From PyPI:
uv add jupyter-book-duplicate-toc-entry
pip install jupyter-book-duplicate-toc-entry
From the NB_TUDelft channel on anaconda.org. Add conda-forge as well, since
that is where the dependencies come from:
conda install -c NB_TUDelft -c conda-forge jupyter-book-duplicate-toc-entry
To follow the unreleased main branch instead of a release, install from Git:
uv add "jupyter-book-duplicate-toc-entry @ git+https://github.com/NB-TUDelft/jupyter-book-duplicate-toc-entry.git"
Configure
Add the Sphinx extension to your Jupyter Book _config.yml:
sphinx:
extra_extensions:
- jupyter_book_duplicate_toc.sphinx
Then run jupyter-book build as usual.
Releasing
Maintainers: see RELEASING.md. In short, bump the version in
pyproject.toml, __init__.py and uv.lock, commit, then push a vX.Y.Z
tag — GitHub Actions publishes to PyPI and anaconda.org from the tag.
License
MIT — see LICENSE.
Metadata
Release files for jupyter-book-duplicate-toc-entry 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jupyter_book_duplicate_toc_entry-0.1.1.tar.gz | 9.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jupyter_book_duplicate_toc_entry-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.0 kB
Release files / jupyter_book_duplicate_toc_entry-0.1.1.tar.gz
| Download URL | jupyter_book_duplicate_toc_entry-0.1.1.tar.gz |
|---|---|
| Size | 9.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
efa19a35ea2fd8e036a1f1ec6d4a2c84012888bb818b2e262bb642786abd70a7
|
|
BLAKE2b-256 checksum How to use checksums |
a5d975cfc4343d32d2cf2e2ee8bc19898ec8b54a70f8946033b2f4098875a5fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / jupyter_book_duplicate_toc_entry-0.1.1-py3-none-any.whl
| Download URL | jupyter_book_duplicate_toc_entry-0.1.1-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8a1ffb5415262bf66d801b351fb5a487345266e741ad1eed9ca67a9d09750e3a
|
|
BLAKE2b-256 checksum How to use checksums |
c56d2b3b60265afa734ab93f37b569611c703443052733519aa5e391f99bd093
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|