[英]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.