繁体   English   中英

从 epydoc 移动到 sphinx 以自动记录一个简单的 python .py 文件

[英]Moving from epydoc to sphinx to auto-document a simple python .py file

即使在应用补丁之后,Epydoc 也无法正常工作,所以我正在尝试转向 Sphinx。

我想从一个简单的 python 文件自动生成文档: test.py

安装并运行sphinx-quickstart-script 后,我将test.py复制到文件夹并输入:

sphinx-build -b html .\\source .\\build

但它只生成 minimiun html 文件,它不解析test.py文件

我的想法用完了。

谢谢你的帮助 :)

您必须在conf.py ( https://www.sphinx-doc.org/en/master/usage/configuration.html ) 中包含sphinx.ext.autodoc作为扩展名, conf.py才能使用.. automodule::指令(或来自这个模块的对象,带有.. autoclass:: , .. autofunction:: , ...)。

https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html

要自动生成必要的.rst文件,您可以使用sphinx-apidoc

这让生活变得更加轻松。 因此,您不必手动记录每个模块。

暂无
暂无

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

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