Jupyter Notebook Slideshows on Connect

jupyter notebook
presentation
Note
  • Turn a Jupyter Notebook into a reveal.js slideshow, then publish that HTML document to Connect.

If you’re familiar with Jupyter Notebooks, you’ve likely seen or encountered the slideshow cell toolbar extension before:

Screenshot of the Jupyter Notebooks View > Cell Toolbar > Slideshow menu

This tool turns notebook cells into slideshow components. Each cell will have a drop-down selector for building the slideshow layout.

Screenshow showing the drop-down selector for building slides

After saving the notebook, utilize nbconvert to generate the slideshow document:

jupyter nbconvert --to slides pyplot.ipynb --reveal-prefix "https://cdn.jsdelivr.net/npm/reveal.js@3.7.0"
Note

I added this reveal-prefix flag to overwrite the default value which wasn’t working properly at the time of this writing. Source: GH Issue

The rsconnect-jupyter extension provides push-button publishing for Jupyter Notebooks, but not for additional static content generated from Jupyter Notebooks. Luckily, the rsconnect R package, does support publication of general static content to Connect.

Since RStudio sessions and Jupyter Notebook sessions share a home directory, it’s easy to switch editors and publish this slideshow document from the RStudio IDE.

Screenshot of the Projects area of the Workbench home page.

The rsconnect package is available in RStudio because I’ve connected the IDE to my Connect publishing account already. To publish this static document to Connect, replace the appPrimaryDoc name with the name of your own file:

rsconnect::deployApp(appPrimaryDoc = "pyplot.slides.html")

When the document is successfully deployed, it will open in Connect where you should be able to interact with the presentation controls:

gif of the Jupyter Notebook slideshow deployed to Connect.

From here you can adjust the access settings so that other people on your team or in your organization can discover and view the slideshow.

Juptyer Slideshow shown on the Connect Content page.

That’s all there is to it! Have fun sharing Jupyter Notebook slideshows!

See this Jupyter Notebook slideshow here: Connect Demo Server

Question:

It looks all you’ve done here is use rsconnect to deploy some static content. Do I need Workbench with the Jupyter Notebooks integration to do that?

Answer: Not at all. This post simply shows a workflow in which you do have this toolchain, and how nifty it is to develop with both Jupyter and RStudio in the same space.

Back to top