From Jupyter to Slides using RISE

In preparation for remote teaching this year, I’ve spent the last few weeks converting the Doctoral Training Centre’s ‘Introduction to Computer Programming’ course into a series of Jupyter notebooks so that the course can be run entirely using Google Colaboratory.

In addition to running the practicals online, we’re also recording all of the lectures ahead of time so that students can watch (and re-watch) as they go. Having just written lots of notebooks, my immediate thoughts were ‘wouldn’t it be nice if I could just turn a notebook into a set of slides?’. Well, it turns out that you can, and using the Jupyter notebook extension ‘RISE’, it’s quick and easy. Here’s how it’s done.

Step 1: Install RISE

RISE is available through PIP or Conda:

pip install RISE
conda install -c conda-forge rise

Step 2: Make slides

Once RISE is installed, open a Jupyter notebook. Under View -> Cell Toolbar, there will be a new ‘Slideshow’ option.

Enabling this will add add the option to set a slide type to each notebook cell. For example, here I’m working on a notebook to use for a lecture on data structures in python. In the first cell, I specify the width of my slides, but I don’t want this to be displayed as a slide, so I can set it to ‘notes’ or ‘skip’. The second cell is my title slide, made using markdown. The third cell contains some text for a slide, entered using markdown. I also want to display the contents of the fourth cell, a python code cell, on the same slide, so I make it a ‘fragment’. This adds it to the same slide as the previous cell.

Finally, clicking the ‘Enter/Exit RISE slideshow’ icon on the notebook toolbar will render your notebook as a deck of slides in your browser. Here’s how my slide and fragment look:

Hopefully this will be useful to anybody who, like me is scrambling to create online lectures!

Author