How to Make a Portable Jupyter Slideshow

2024/10/4 15:34:15

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.

Answer

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.

https://en.xdnf.cn/q/70594.html

Related Q&A

How to animate a bar char being updated in Python

I want to create an animated, stacked bar chart.There is a great tutorial, which shows how to animate line graphs.However, for animating bar charts, the BarContainer object, does not have any attribute…

Add text to end of line without loading file

I need to store information into a very big file, in form of many dictionaries. Thats not so important, is just to say that I tried to first get all the data into these dictionaries and I run out of me…

How does one use `dis.dis` to analyze performance?

Im trying to use pythons dis library to experiment with & understand performance. Below is an experiment i tried, with the results.import disdef myfunc1(dictionary):t = tuple(dictionary.items())ret…

How do I require HTTPS for this Django view?

(r^login/?$,django.contrib.auth.views.login,{template_name:login.html, authentication_form:CustomAuthenticationForm}),How do I add HTTPS required to this? I usually have a decorator for it..But in th…

How many times a number appears in a numpy array

I need to find a way to count how many times each number from 0 to 9 appears in a random matrix created using np.random.randint()import numpy as np p = int(input("Length of matrix: ")) m = np…

python: How to remove values from 2 lists based on whats in 1 list

I have 2 lists of numbers, one called xVar and the other called yVar. I will use these 2 elements to plot X and Y values on a graph. They both have the same number of elements. Normally, I would jus…

merge two dataframe columns into 1 in pandas

I have 2 columns in my data frame and I need to merge it into 1 single columnIndex A Index B 0 A 0 NAN 1 NAN 1 D 2 B 2 …

Upsample and Interpolate a NumPy Array

I have an array, something like:array = np.arange(0,4,1).reshape(2,2)> [[0 12 3]]I want to both upsample this array as well as interpolate the resulting values. I know that a good way to upsample an…

How to extract text from table in image?

I have data which in a structured table image. The data is like below:I tried to extract the text from this image using this code:import pytesseract from PIL import Imagevalue=Image.open("data/pic…

numpy.savetxt tuple index out of range?

Im trying to write a few lines into a text file, and heres the code I used:import numpy as np# Generate some test data data = np.arange(0.0,1000.0,50.0)with file(test.txt, w) as outfile: outfile.w…