我有要记录的模块,以便目录位于主页上index
,而文档本身位于单独的页面中。我是自动文档和 Sphinx 的新手,但我已经接近了:
index.rst:
Documentation
*************
.. toctree::
:maxdepth: 2
Module1
Module2
Index
=====
* :ref:`genindex`
* :ref:`modindex`
Module1.rst and Module2.rst:
Title
*****
.. automodule:: Module1 (or Module2)
:noindex:
:members:
使用的原因noindex
是得到重复的对象描述错误。但是,这会阻止模块出现toctree
在index
. 如何避免这种情况?这似乎是一件基本的事情,但我无法理解它。任何帮助将不胜感激!
似乎这个问题及其答案试图解决类似的问题,但我认为它并不完全相同,因为 OP 对答案发表了评论。