4

When I download a Jupyter Notebook as slides, the links are not active (i.e. they don't take you anywhere). How do I link a table of contents page to the respective slides?

Linking to a cell can be done by anchoring it and then calling it later see answer here (e.g. place<a id="another_cell"></a> in the desired cell to jump to and place [Another Cell](#another_cell) where you'd click "Another Cell"). This works fine in an download of the Reveal.JS as a PDF, but not when doing slides.

Current code to publish with nbconvert:

jupyter nbconvert SOME_NOTEBOOK.ipynb
--to slides
--output-dir .\SOME_FOLDER
--SlidesExporter.reveal_theme=serif
--SlidesExporter.reveal_scroll=True
--SlidesExporter.reveal_transition=none
--TemplateExporter.exclude_input=True
--TemplateExporter.exclude_output_prompt=True
--reveal-prefix=./lib/reveal.js-3.8.0
MaxPi
  • 719
  • 1
  • 6
  • 12

1 Answers1

2

You can try this:

<a href="#/2"> Slide number 2 </a>

Note: The slide count starts after the slide that has the table of contents.

atmyo
  • 21
  • 3
  • This works great. Anyone know how to programmatically compute the slide number at `nbconvert` time so that we don't need to hard-code the slide numbers? – Zephaniah Grunschlag Nov 20 '22 at 15:20