
️ REFACTOR: Delegate ToC logic to sphinx-external-toc (#1293)

This commit removes all code related to the `_toc.yml`, which is now implemented in https://github.com/executablebooks/sphinx-external-toc. This implementation adds a range of new features, including: - `glob` to specify multiple files with unix-style wildcard - `toctree` options: `caption`, `hidden`, `maxdepth`, `numbered`, `titlesonly` - The `toctree` are now added directly to the docutils/sphinx AST (rather than appending to the source text), which means that its is source format agnostic, i.e. will work for rst, md, ipynb, py, ... - The `tableofcontents` directive is also handled at the same time as the `toctree` insertion, rather than later in a post-transform, which avoids having to use any builder specific logic. - The `jupyter-book toc` CLI is now a plugin of the sphinx-external-toc CLI, and is split into multiple commands - The new `jupyter-book toc to-site` command allows a template project to be generated directly from a `toc.yml` The format of the `_toc.yml` has been changed slightly. To aide users, the code in `jupyter-book build` will check the format is as expected before calling sphinx, and point users to the new `jupyter-book toc migrate` command. This also involved updating `jupyterbook-latex` to `v0.3.0`, and removes the `nested-lookup` dependency.
Showing
- .flake8 0 additions, 3 deletions.flake8
- .gitignore 1 addition, 1 deletion.gitignore
- .pre-commit-config.yaml 9 additions, 4 deletions.pre-commit-config.yaml
- MANIFEST.in 0 additions, 1 deletionMANIFEST.in
- docs/_toc.yml 15 additions, 21 deletionsdocs/_toc.yml
- docs/reference/cli.md 1 addition, 1 deletiondocs/reference/cli.md
- jupyter_book/__init__.py 1 addition, 19 deletionsjupyter_book/__init__.py
- jupyter_book/book_template/_toc.yml 3 additions, 1 deletionjupyter_book/book_template/_toc.yml
- jupyter_book/cli/__init__.py 0 additions, 0 deletionsjupyter_book/cli/__init__.py
- jupyter_book/cli/main.py 49 additions, 79 deletionsjupyter_book/cli/main.py
- jupyter_book/cli/pluggable.py 52 additions, 0 deletionsjupyter_book/cli/pluggable.py
- jupyter_book/config.py 24 additions, 48 deletionsjupyter_book/config.py
- jupyter_book/directive/toc.py 0 additions, 184 deletionsjupyter_book/directive/toc.py
- jupyter_book/pdf.py 4 additions, 3 deletionsjupyter_book/pdf.py
- jupyter_book/sphinx.py 6 additions, 33 deletionsjupyter_book/sphinx.py
- jupyter_book/toc.py 0 additions, 387 deletionsjupyter_book/toc.py
- jupyter_book/utils.py 1 addition, 18 deletionsjupyter_book/utils.py
- pyproject.toml 6 additions, 0 deletionspyproject.toml
- scripts/clear_doc_outputs.py 2 additions, 1 deletionscripts/clear_doc_outputs.py
- setup.py 9 additions, 8 deletionssetup.py
Loading
Please register or sign in to comment