Python R Markdown 的替代品

Python alternative to R Markdown

使用 R 的人无疑熟悉 R markdown package

我是一个生动的 python 用户并使用 Mistune 将 markdown 转换为 html 页面。它还支持代码高亮和 mathjax 以在 html 中嵌入乳胶公式。但是缺少一种功能。

R markdown 可以内联执行 R 代码(并将结果渲染到 html)或内联渲染图形。这节省了时间并使文档易于维护,因为您不需要手动准备该函数的输出或手动准备和保存图形,因为它是动态呈现的。

python中是否有这样的可能性或库,也许与 Mistune 结合使用?

你真的应该看看 ipython notebook (now it's called Jupyter because it supports many languages including R), it can be a little difficult to install for those beginning with Python, so I might also suggest the Anaconda Python Distribution 默认情况下包含它。

允许您执行代码、输入 markdown 格式的文本、显示图表等等。