简体   繁体   English

如何将ReStructuredText文档转换为ipython笔记本?

[英]How to convert ReStructuredText docs to ipython notebooks?

A lot of documentation in the python community these days is written in ReStructuredText. 现在python社区中的许多文档都是用ReStructuredText编写的。 I want to convert some of these docs to ipython notebooks so that it is possible to not just read the examples in the docs, but interact with them immediately. 我想将其中一些文档转换为ipython笔记本,以便不仅可以阅读文档中的示例,而且可以立即与它们进行交互。

How can I convert ReStructuredTexts to ipython notebooks? 如何将ReStructuredTexts转换为ipython笔记本? Is there any way to do this? 有没有办法做到这一点? Maybe using pandoc as an intermediate step? 也许使用pandoc作为中间步骤?

I have already read some docs on how to convert ipython notebooks to other formates, but I am interested in doing it the other way around, from rst to iptyhon. 我已经阅读了一些关于如何将ipython笔记本转换为其他格式的文档 ,但我感兴趣的是反过来,从rst到iptyhon。 Any ideas? 有任何想法吗?

In addition to sphinxcontrib-jupyter / jupinx , Google found rst2ipynb . 除了sphinxcontrib-jupyter / jupinx之外 ,Google还发现了rst2ipynb It seems to use pandoc. 它似乎使用pandoc。 I haven't yet tried it myself though. 我自己还没试过。

There's a package for markdown to ipynb. ipynb有一个降价包。 notedown 1.0.3 . 注意到1.0.3 You could use pandoc for rst to md then md to ipynb. 您可以将pandoc用于第一个到md,然后使用md到ipynb。

If you are still looking for a solution, we are building a Sphinx extension to convert a collection of RST files to Jupyter notebooks. 如果您仍在寻找解决方案,我们正在构建一个Sphinx扩展,将一组RST文件转换为Jupyter笔记本。

sphinxcontrib-jupyter sphinxcontrib-jupyter

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM