gpt4 book ai didi

python - 我怎样才能让 'autodoc' 工作?

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

当我制作htmlthis little project的Sphinx文档时我得到:

$ make html
sphinx-build -b html -d _build/doctrees . _build/html
Running Sphinx v1.1.3
loading pickled environment... done
building [html]: targets for 1 source files that are out of date
updating environment: 0 added, 1 changed, 0 removed
reading sources... [100%] index
/home/moose/Downloads/lumix_map_tool/doc/index.rst:16: WARNING: don't know which module to import for autodocumenting u'maptool' (try placing a "module" or "currentmodule" directive in the document, or giving an explicit module name)
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] index
writing additional files... genindex search
copying static files... done
dumping search index... done
dumping object inventory... done
build succeeded, 1 warning.

我的目录结构是

.
├── doc (automaticall generated by sphinx-quickstart)
├── LICENSE
├── maptool.log
├── maptool.py
└── README.md

我已将 sys.path.insert(0, os.path.abspath('/home/moose/Downloads/lumix_map_tool/')) 添加到 doc/conf.py .

为什么Sphinx找不到maptool.py

最佳答案

您有一个名为 maptool 的模块,但在 GitHub 项目的 index.rst 中它显示:

.. autoclass:: maptool
:members:
:undoc-members:

如果将 autoclass 更改为 automodule,它应该可以工作。

关于python - 我怎样才能让 'autodoc' 工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22719209/

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