Slideshows from Jupyter notebook

installation, run, structure, split cells, hide code, host in github
jupyter
Published

June 25, 2021

Installation, configuration

nice explanation from Mark Roekpe’s blog

Slide is a native function from Jupyter (through nbconvert). However one can install RISE to get some additional features.

conda install -c conda-forge rise

pip install RISE

And then for each cell I can decide if I want: - slide - indicates that the selected cell should be the start of a new slide - sub-slide - indicates that the selected cell should be the start of a new sub-slide, which appears in a new frame beneath the previous slide - fragment - indicates that the selected cell should appear as a build to the previous slide - skip - indicates that the selected cell should be skipped and not be a part of the slideshow - notes - indicates that the selected cell should just be presenter notes - - - indicates that the selected cell should follow the behavior of the previous cell, which is useful when a markdown cell and a code cell should appear simultaneously

Slides are structured this way. To progress we can go right (for new slides) or bottom (for sub-slides).

And we can decide to have new pages (slides / sub-slides) or new fragment in the same page (fragment).

Run slides

We can launch slideshow with RISE button (or Alt-R)

Or we can serve pages through nbconvert:

jupyter nbconvert my_notebook.ipynb --to slides --post serve
!jupyter nbconvert 2021-06-25-slide-show-jupyter.ipynb --to slides --post serve
[NbConvertApp] WARNING | Config option `kernel_spec_manager_class` not recognized by `NbConvertApp`.
[NbConvertApp] Converting notebook 2021-06-25-slide-show-jupyter.ipynb to slides
Serving your slides at http://127.0.0.1:8000/2021-06-25-slide-show-jupyter.slides.html
Use Control-C to stop this server
WARNING:tornado.access:404 GET /favicon.ico (127.0.0.1) 0.41ms
^C

Interrupted

RISE vs nbconvert

RISE nbconvert
run Alt-R or click Rise icon cmd line: jupyter nbconvert <name>.ipynb --to slides --post serve
split cells supported not supported
keyboard shortcuts ← → ⇞ ⇟ ← ↑ → ↓

some extensions

tips from Mark Roekpe’s blog. Valid mainly for RISE.

  • splicell
  • hide code from slideshow
  • custom css
  • open slides automatically