7

How do I make a Jupyter slide show portable? I can serve the slideshow locally, but I can't send that to anyone and have it work with all the images, slide animation functionality, etc.

I am using jupyter nbconver my_notebook.ipynb --to slides and get a simple linear html file that depends on the files being on the machine where the file is used.

aeolus
  • 159
  • 3
  • 11

1 Answers1

6

You should specify --reveal-prefix to convert it, nbconvert doc.

jupyter nbconvert my_notebook.ipynb --to slides --post serve --reveal-prefix "http://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.3.0"

You may also use a local Reveal.js library, see here.

If you want a PDF, add ?print-pdf to the address of the running html, like:

http://127.0.0.1:8000/my_notebook.slides.html/reveal-js?print-pdf

Then save(print) it as pdf.


You may also want to have a look at nbpresent.

Syrtis Major
  • 3,791
  • 1
  • 30
  • 40
  • The first option `--reveal-prefix` is nearly exactly what I was looking for. Is there any way to freeze/embed pictures that are referenced in markdown cells though? – aeolus Jun 25 '16 at 01:47
  • @aeolus I've no idea. I guess there are two workaround: save it as pdf or show your figures with notebook/ipython image tools like `IPython.display.Image`. – Syrtis Major Jun 25 '16 at 01:53
  • It's possible to embed pictures in HTML, as the figures generated by `matplotlib` are embedded. I guess you may find some tools to do this in HTML world. – Syrtis Major Jun 25 '16 at 02:01
  • Look at [this](http://stackoverflow.com/questions/1207190/embedding-base64-images) and [this](http://stackoverflow.com/questions/3715493/encoding-an-image-file-with-base64). I guess you may use python to convert your image to base64 string, and insert it to your markdown cell with ``. – Syrtis Major Jun 25 '16 at 02:14