<p>我可以看到两个解决方案,以嵌入您的笔记本电脑细胞与绘图数字斯芬克斯文件。在</p>
<ol>
<li>使用nbconvert或nbsphinx将笔记本转换为html。一定要使用<code>notebook</code>渲染器来包含plotly javascript捆绑包(也许这就是您的图形没有显示的原因):请参见<a href="https://plot.ly/python/renderers/" rel="nofollow noreferrer">https://plot.ly/python/renderers/</a>以获取有关绘图渲染器的文档。然后您可以在sphinx文档中包含html和各种解决方案(请参见<a href="https://stackoverflow.com/questions/48889270/include-standalone-html-page-in-sphinx-document">Include standalone HTML page in sphinx document</a>)。在</li>
<li>使用斯芬克斯画廊(<a href="https://sphinx-gallery.github.io/" rel="nofollow noreferrer">https://sphinx-gallery.github.io/</a>)及其绘图刮刀。使用sphinx gallery,您可以将文档页面编写为python脚本,该脚本由sphinx的sphinx gallery扩展转换为rest。要配置刮板,请参见<a href="https://sphinx-gallery.github.io/advanced.html#integrate-custom-scrapers-with-sphinx-gallery" rel="nofollow noreferrer">https://sphinx-gallery.github.io/advanced.html#integrate-custom-scrapers-with-sphinx-gallery</a>。我们还有一个最小的存储库,展示了如何在<a href="https://github.com/plotly/plotly-sphinx-gallery" rel="nofollow noreferrer">https://github.com/plotly/plotly-sphinx-gallery</a>中一起使用plotly和sphinx gallery。
<a href="https://github.com/plotly/plotly-sphinx-gallery" rel="nofollow noreferrer">https://github.com/plotly/plotly-sphinx-gallery</a></li>
</ol>