Add Section in Jupyter Notebook linked to page specific table of contents

865 Views Asked by At

First... I know this is in the docs, I've seen it in the docs, but Jupyter's docs are so dreadfully ill equipped it's beyond belief.

I'm just looking to add a "Section" as described in the docs below a few cells and since this is my first time using Jupyter notebooks I'm not familiar enough to remember the syntax. The docs specifically mentioned this "Section" would be added to the page level table of contents on build, but again... I can not find something I just read a week ago for the life of me.

I spent 20-30 minutes looking through their docs for something I've already found like a week ago, but they're so poorly organized it just sent me in circles. I'm aware this might be Sphinx thing rather than Jupyter directly, but if someone glances over this that uses Jupyter regulary I'm sure this a commonly used thing. Any help is phenomenal, Thanks!

1

There are 1 best solutions below

0
On

Ok, after combing Sphinx docs, Jupyter, Jupyter notebooks, and the Sphinx-Jupyter theme docs, it's in the Jupyter Book docs located here:

https://jupyterbook.org/en/stable/structure/sections-headers.html?highlight=Sections#how-headers-and-sections-map-onto-to-book-structure

For anyone trying to find this at a quick glance the _toc.yml file needs to be marked up like so:

format: jb-book
root: myintro
chapters:
- file: chapter1
  sections:
  - file: chapter1section1
- file: chapter2
  sections:
  - file: chapter2section1
  - file: chapter2section2