假设我有两个 .rst 文件,一个欢迎页面(索引)和一个API页面。我希望它们都具有相同的toctree,所以很容易从一个页面导航到另一页面。
index.rst :
Welcome!
========
Welcome to these awesome docs!
api.rst :
API
===
Here is some API stuff...
我尝试将toctree添加到index.rst
,如下所示:
.. toctree::
:hidden:
index
api
然后我的toctree被嵌套了:
我不仅要添加
.. toctree::
:hidden:
api
到 index.rst 和
.. toctree::
:hidden:
index
到 api.rst ,因为这意味着侧边栏在页面之间是不同的。
如何为项目添加全局索引?不管我在哪一页上都一样?