Jupyter Notebook还支持幻灯片的制作和播放。
在菜单栏选择View > Cell Toolbar > Slideshow
,这时在文档的每个单元右上角都会多出一个Slide Type
选项。通过设置不同的类型,可以控制幻灯片的格式。有如下五种类型:
演示幻灯片形式的notebook文档需要使用 nbconvert:
jupyter nbconvert filename.ipynb --to slides --post serve
在命令行中运行上述命令后,浏览器会自动打开相应的幻灯片。
最好的办法是打开一个终端:
然后执行命令:
jupyter nbconvert jupyter_test.ipynb --to slides --post serve
PS C:\Users\feixuelym> jupyter nbconvert jupyter_test.ipynb --to slides --post serve [NbConvertApp] Converting notebook jupyter_test.ipynb to slides [NbConvertApp] Writing 255596 bytes to jupyter_test.slides.html [NbConvertApp] Redirecting reveal.js requests to https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.5.0 Serving your slides at http://127.0.0.1:8000/jupyter_test.slides.html Use Control-C to stop this server WARNING:tornado.access:404 GET /custom.css (127.0.0.1) 0.00ms WARNING:tornado.access:404 GET /custom.css (127.0.0.1) 1.00ms WARNING:tornado.access:404 GET /favicon.ico (127.0.0.1) 1.01ms