Skip to content
Snippets Groups Projects
Unverified Commit 18d52700 authored by Chris Sewell's avatar Chris Sewell Committed by GitHub
Browse files

:recycle:️ 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.
parent b81d7029
No related branches found
No related tags found
No related merge requests found
Showing
with 183 additions and 812 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment