gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-01 06:01:36 25 4
gpt4 key购买 nike

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

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

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

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

但它只生成最小的 html 文件,并且不解析 test.py 文件

我已经没有主意了。

感谢您的帮助:)

最佳答案

您必须将 sphinx.ext.autodoc 作为扩展包含在您的 conf.py ( https://www.sphinx-doc.org/en/master/usage/configuration.html ) 中,然后才能使用 记录您的模块>.. automodule:: 指令(或此模块中带有 .. autoclass::.. autofunction::、... 的对象)。

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

关于python - 从 epydoc 迁移到 sphinx 以自动记录简单的 python .py 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10130941/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com