sphinx/autodoc toc未列出子弹

发布于 2025-02-13 23:17:04 字数 1863 浏览 0 评论 0原文

我有以下结构的小存储库:

|- doc/
    |- conf.py
    |- index.rst
    |- ...
|- src/dashtutorial/
    |- __init__.py
    |- data/
    |   |- __init__.py
    |   |- types.py
    |- gui/
        |- __init__.py
        |- components/
        |   |- __init__.py
        |   |- ...
        |- ...
    |- ...

我正在使用sphinx的sphinx-apidocnapoleon,并且可以成功地构建文档并查看HTML输出。

但是,由于某种原因,我在侧栏中看到 no toc/package路径(我正在使用rtd主题)。 所有内容都在那里,我可以使用索引或搜索页面对文档的每个内容进行操纵。 一旦我移动到一个内容,唯一的 当前软件包将显示在侧栏中。

结果模块。RST文件仅列出root/main软件包dashtutorial

src
===

.. toctree::
   :maxdepth: 4

   dashtutorial

这是index.rst文件:

.. Dash Tutorial documentation master file, created by
   sphinx-quickstart on Fri Jul  8 10:54:39 2022.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

Welcome to Dash Tutorial's documentation!
=========================================

.. toctree::
   :maxdepth: 4
   :caption: Contents:



Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

我在conf.py中插入了所有路径:

import os
import sys
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath('../src/'))
sys.path.insert(0, os.path.abspath('../src/dashtutorial/'))
sys.path.insert(0, os.path.abspath('../src/dashtutorial/data/'))
sys.path.insert(0, os.path.abspath('../src/dashtutorial/gui/'))
sys.path.insert(0, os.path.abspath('../src/dashtutorial/gui/components/'))

编辑:运行后进行清洁html,我接收... \ modules.rst:警告:任何toctree edit2:document int of toctree

edit2:是否有任何必不可少的东西可以构建基本TOC结构,我我失踪了吗?

I have a small repository of the following structure:

|- doc/
    |- conf.py
    |- index.rst
    |- ...
|- src/dashtutorial/
    |- __init__.py
    |- data/
    |   |- __init__.py
    |   |- types.py
    |- gui/
        |- __init__.py
        |- components/
        |   |- __init__.py
        |   |- ...
        |- ...
    |- ...

I'm using sphinx's sphinx-apidoc and napoleon and I can successfully build the documentation and view the html output.

However, for some reason, I see no TOC/package paths in the side bar (I'm using the rtd theme).
All contents are there, I can use the index or search page to maneuver to every content of the documentation.
Once I moved to a content, only the current package is displayed in the side bar.

The resulting modules.rst file only lists the root/main package dashtutorial.

src
===

.. toctree::
   :maxdepth: 4

   dashtutorial

This is the index.rst file:

.. Dash Tutorial documentation master file, created by
   sphinx-quickstart on Fri Jul  8 10:54:39 2022.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

Welcome to Dash Tutorial's documentation!
=========================================

.. toctree::
   :maxdepth: 4
   :caption: Contents:



Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

I inserted all paths in the conf.py:

import os
import sys
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath('../src/'))
sys.path.insert(0, os.path.abspath('../src/dashtutorial/'))
sys.path.insert(0, os.path.abspath('../src/dashtutorial/data/'))
sys.path.insert(0, os.path.abspath('../src/dashtutorial/gui/'))
sys.path.insert(0, os.path.abspath('../src/dashtutorial/gui/components/'))

EDIT: After running make clean and make html, I receive ...\modules.rst: WARNING: document isn't included in any toctree

EDIT2: Is there anything essential to subpackages building the basic TOC structure, that I'm missing?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文