In order to export your notebooks as Reveal.js slides, follow these steps:
JupyterLab allows you to export your jupyter notebook files (.ipynb) into other file formats. For creating slides, we can use:
To access these options, while a notebook is open, browse the File menu:
{
"slideshow": {
"slide_type": "fragment"
},
"tags": [
"to_remove"
]
}
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
# Turn interactive mode on
plt.ion()
data = np.random.randn(2, 100)
fig, ax = plt.subplots()
ax.scatter(*data, c=data[1], s=100*np.abs(data[0]));
Figure: scatterplot with random data
!jupyter nbconvert presentation.ipynb --to slides --no-prompt --TagRemovePreprocessor.remove_input_tags={\"to_remove\"}
[NbConvertApp] Converting notebook presentation.ipynb to slides [NbConvertApp] Writing 323700 bytes to presentation.slides.html
html
.lab
to tree
in the Jupyterhub address.For instance, if you adress is
https://abisko.uiogeo-apps.sigma2.no/user/df0bb829-8d2d-487e-9748-cf1b58c1ab4b/lab
then the corresponding standard jupyter noteboo view is
https://abisko.uiogeo-apps.sigma2.no/user/df0bb829-8d2d-487e-9748-cf1b58c1ab4b/tree
You can hide cells, for instance to hide the generation of your slides.
!jupyter nbconvert presentation.ipynb --to slides --no-prompt --TagRemovePreprocessor.remove_input_tags={\"to_remove\"}
[NbConvertApp] Converting notebook presentation.ipynb to slides [NbConvertApp] Writing 323700 bytes to presentation.slides.html
if you add images (not generated by python plotting), it is important to download these images too (for instance to the github repositoy).
In presentation mode, you can know more about the reveal-specific shortcuts just pressing the help button at the slideshow left bottom corner.
Darkish themes have css conflict with the notebook css, so it need customization to make them work (not provided by default).
Markdown Images get left aligned by default. Enclose the image like <center>![noimg](path/to/image.png)</center>
to center it.
simple
theme is usedsky
!jupyter nbconvert presentation.ipynb --to slides --no-prompt --TagRemovePreprocessor.remove_input_tags={\"to_remove\"} --SlidesExporter.reveal_theme=sky
[NbConvertApp] Converting notebook presentation.ipynb to slides [NbConvertApp] Writing 319216 bytes to presentation.slides.html
List of available theme at https://github.com/hakimel/reveal.js/tree/master/css/theme