跨页面共享全局toctree

时间:2020-03-09 15:44:29

标签: python-sphinx toctree

假设我有两个 .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被嵌套了:

enter image description here

我不仅要添加

.. toctree::
   :hidden:

   api

index.rst

.. toctree::
   :hidden:

   index

api.rst ,因为这意味着侧边栏在页面之间是不同的。

如何为项目添加全局索引?不管我在哪一页上都一样?

0 个答案:

没有答案