我有一些 Sphinx 文档,如下所示:
Browse the code-based documentation here:
.. autosummary::
:toctree: _autosummary
:template: custom-module-template.rst
:recursive:
foo
Run Code Online (Sandbox Code Playgroud)
有、、等foo的模块在哪里?有办法排除吗?foo.barfoo.bar.afoo.bazfoo.baz
我正在使用 Sphinx 生成 python 包的 API 文档。目前我收到警告
WARNING: duplicate object description of package.module.submodule.Class.function other instance in generated/package.module.submodule, use :noindex: for one of them
Run Code Online (Sandbox Code Playgroud)
基本上每个函数都会产生 300 多个警告。
我的 RST 文件如下所示:
api.rst:
.. autosummary::
:toctree: generated
:recursive:
:template: module-template.rst
package
Run Code Online (Sandbox Code Playgroud)
模块模板.rst:
{{ fullname | escape | underline}}
{% block modules %}
{% if modules %}
.. rubric:: {{ _('Submodules') }}
.. autosummary::
:toctree:
:template: module-template.rst
:recursive:
{% for item in modules %}
{{ item }}
{%- endfor %}
{% endif %}
{% …Run Code Online (Sandbox Code Playgroud)