Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you link to a slide in a Jupyter Notebook saved as Reveal.JS?

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
like image 725
MaxPi Avatar asked Sep 19 '25 04:09

MaxPi


1 Answers

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.

like image 148
atmyo Avatar answered Sep 20 '25 23:09

atmyo