幻灯片的IPython笔记本:没有定义显示 [英] IPython notebook to slides: Reveal is not defined

查看:105
本文介绍了幻灯片的IPython笔记本:没有定义显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用nbconvert从我的笔记本中制作一个reveal.js幻灯片。具体来说,我正在运行: ipython nbconvert - to slides analysis.ipynb 。这会创建analysis.slides.html,并将reveal.js放在同一个文件夹中。也就是说,我有:

I'm using nbconvert to make a reveal.js slideshow from my notebook. Specifically, I'm running: ipython nbconvert --to slides analysis.ipynb. This creates "analysis.slides.html", and I put "reveal.js" in the same folder. That is, I have:


  • reveal.js

    • ...

    但是,在浏览器JavaScript控制台中打开analysis.slides.html时,我得到以下信息:

    However, when opening "analysis.slides.html" in the browser JavaScript console, I get the following:

    analysis.slides.html:1992 Uncaught ReferenceError: Reveal is not defined
    analysis.slides.html:2032 Uncaught ReferenceError: Reveal is not defined
    require.min.js:8 Uncaught Error: Mismatched anonymous define() module: function () {
            root.Reveal = factory();
            return root.Reveal;
        }
    http://requirejs.org/docs/errors.html#mismatch
    

    对于加载reveal.js - < script src =reveal.js / js / reveal.js>< / script> <的行,我没有收到404错误/ code> - 所以任何想法为什么我可能会看到我的错误?

    I don't get a 404 error for the line which loads reveal.js - <script src="reveal.js/js/reveal.js"></script> - so any ideas why I might be seeing the errors I am?

    谢谢!

    推荐答案

    这个答案中看到了揭示.js版本3.0.0 isn'与IPython兼容,因此解决方案是使用旧版本,例如 ipython nbconvert --to slides analysis.ipynb --reveal-prefixhttp://cdn.jsdelivr.net/reveal.js/2.6.2\".

    Saw in this answer that reveal.js version 3.0.0 isn't compatible with IPython, so the solution is to use an older version, e.g. ipython nbconvert --to slides analysis.ipynb --reveal-prefix "http://cdn.jsdelivr.net/reveal.js/2.6.2".

    这篇关于幻灯片的IPython笔记本:没有定义显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆