Jupytoc generates table of contents for jupyter notebook files. Links are compatible with anchors generated by GitHub.
📌 A commmand-line interface to add/update/delete TOC to Jupyter Notebooks
$ jupytoc <jupyter_notebook>
To add toc for all files in a directory, just launch:
$ jupytoc .
$ jupytoc --help
Usage: jupytoc [OPTIONS] [NOTEBOOKS]...
Options:
-R, --recursive build TOC for all subdirectories recursively
-l, --maxlevel INTEGER limit TOC entries to headings only up to the
specified level
-t, --title TEXT custom TOC title
-s, --stdout print to stdout
-d, --delete remove TOC from notebook file
--help Show this message and exit.
$ jupytoc -R
Use --title
option to specify a custom TOC title (Markdown formatted).
e.g. :
$ jupytoc --title '**Contents**'
Use --maxlevel
option to limit TOC entries to a certain level.
By default, Jupyter Notebook headings are limited to 6 levels.
$ jupytoc --maxlevel 2
Use --stdout
flag to print to stdout.
$ jupytoc --stdout
Use --delete
option to delete a TOC.
$ jupytoc --delete <jupyter_notebook>
GitHub for the latest development version
$ pip install git+https://github.com/axelbellec/jupytoc
Jupytoc has the following dependencies:
- generate TOC a top of file
- add/update an existing TOC in Markdown file
- add/update TOC for all files in the current directory
- handle multiple files input
- limit TOC entries
- add/udpate TOC to all files in a directory/sub directories
- enable custom TOC title editing
- print TOC to stdout
- delete TOC option
- Test suite
1. Why do my link anchors generated with jupytoc
not work when the notebook is read on Github?
GitHub rending concerning .ipynb
notebooks do not let us to navigate through links.