Exporting an IPython Notebook Dashboard to an HTML slideshow

In this recipe, you'll learn how to export an IPython Notebook Dashboard to an HTML file. The dashboard we have created will export to a single page; however, you can easily turn it into multiple slides for a presentation. Also, this is my preferred HTML export method, so I recommend using it.

Converting a notebook to slides generates a reveal.js HTML slideshow. In order to work correctly, it must be served by a web server.

If you produce actual slides from your notebook, download the reveal.js library (https://github.com/hakimel/reveal.js) to make them interactive.

Creating even a single-page slideshow is my preference, as I believe it looks the best of all the exported formats.

How to do it…

  1. First, build your dashboard.
  2. Next, change into the directory containing your notebook file.
  3. Lastly, run the following command:
    jupyter nbconvert --to slides --execute 'name_of_notebook.ipynb'
    

How it works…

With the dashboard created, we use nbconvert to execute our dashboard using the --execute argument, and export it to an HTML slideshow using the --to slides argument. This will create a single HTML file that, along with the reveal.js library, can be deployed to a web server for sharing.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset