如何在 reStructuredText 中添加指向其他页面的链接?

How can i add links to other pages in reStructuredText?

我正在使用 Sphinx 为我的项目创建文档,但我很难理解有关 RST 的基本概念。

所以我有一个带有 index.rst 的基本项目,我正在使用 sphinx-rtd-theme 来设置它的样式。所以我创建了 html 并且在左侧我有一个菜单,就像 here 一样。现在我为文档创建了一个新页面,第一个文件名为 auth.rst.

我不明白的是如何在左侧的侧边菜单中添加指向其他页面的链接,例如 auth.rst?现在,我在那个菜单上有两个链接:Welcome to Test-API's documentation! and Indices and tables,如何我应该添加指向文档其他页面的新链接吗?我不明白这在下面的代码中定义在哪里,我也没有找到太多关于这个的信息

Welcome to Test-API's documentation!
================================

.. toctree::
   :maxdepth: 2
   :caption: Contents:



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

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

在“:caption ...”下面,您将相对路径(从这个 RST 文件在磁​​盘上的位置)写到目标 rst(auth.rst 在您的例子中)

示例,给定此文件夹结构:

RST
  |- a.rst
  |- b.rst
  |-folder2 
    |-c.rst
    |-d.rst

在 a 中,如果我想引用 b 和 c,我可以:

.. toctree::
   :maxdepth: 2
   :caption: Contents:
   b
   folder2/c

如果我想从 c 引用 d,我会在 c:

.. toctree::
   :maxdepth: 2
   :caption: Contents:
   d