sphinxcontrib-pyexec
项目描述
# PyExec
[点击查看](http://sphinxcontrib-pyexec.readthedocs.io/en/latest/?badge=latest) [点击查看](https://travis-ci.org/3ptscience/sphinxcontrib-pyexec)
Sphinx 的一个扩展,用于运行 Python 代码并显示输入和
输出 [Sphinx 文档](https://sphinx-doc.cn/).
在 conf.py 中将 `PyExec` 添加到您的扩展列表中。
在 ReStructuredText 文件中,使用 `exec` 环境
```
.. exec:
print 2 + 2
```
以在您的文档中输出 Python 代码及其结果。
```
>> print 2 + 2
4
```
注意,您需要包含 `print` 语句以显示输出。要查看实际效果,请查看 [Properties 文档](http://propertiespy.readthedocs.io/).
基于
- https://github.com/sphinx-doc/sphinx/blob/master/sphinx/directives/code.py
- http://stackoverflow.com/a/18143318/6086999
[点击查看](http://sphinxcontrib-pyexec.readthedocs.io/en/latest/?badge=latest) [点击查看](https://travis-ci.org/3ptscience/sphinxcontrib-pyexec)
Sphinx 的一个扩展,用于运行 Python 代码并显示输入和
输出 [Sphinx 文档](https://sphinx-doc.cn/).
在 conf.py 中将 `PyExec` 添加到您的扩展列表中。
在 ReStructuredText 文件中,使用 `exec` 环境
```
.. exec:
print 2 + 2
```
以在您的文档中输出 Python 代码及其结果。
```
>> print 2 + 2
4
```
注意,您需要包含 `print` 语句以显示输出。要查看实际效果,请查看 [Properties 文档](http://propertiespy.readthedocs.io/).
基于
- https://github.com/sphinx-doc/sphinx/blob/master/sphinx/directives/code.py
- http://stackoverflow.com/a/18143318/6086999
项目详情
下载文件
下载适用于您平台的文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。
源代码发行版
sphinxcontrib-pyexec-0.0.4.tar.gz (4.3 kB 查看哈希值)
关闭
sphinxcontrib-pyexec-0.0.4.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 306a1481f2eb3f5f9ef274a3b15843c6f77db0b414970b2c2a9ff6ecf22f9a19 |
|
MD5 | 638b08e655d1ad413adc2d94cec039a5 |
|
BLAKE2b-256 | 8d2dd020aaf5b45b3a7ca316c9c217273be04adda5096b1283ae96dccb9f0dea |