我正在使用 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)