Jupyter Notebook Slideshows on Connect
- 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:
This tool turns notebook cells into slideshow components. Each cell will have a drop-down selector for building the slideshow layout.
After saving the notebook, utilize nbconvert to generate the slideshow document:
--to slides pyplot.ipynb --reveal-prefix "https://cdn.jsdelivr.net/npm/reveal.js@3.7.0" jupyter nbconvert
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.
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:
::deployApp(appPrimaryDoc = "pyplot.slides.html") rsconnect
When the document is successfully deployed, it will open in Connect where you should be able to interact with the presentation controls:
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.
That’s all there is to it! Have fun sharing Jupyter Notebook slideshows!
See this Jupyter Notebook slideshow here: Connect Demo Server
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.