How can I link/reference another reST file in the documentation?

Aditya ultra picture Aditya ultra · May 31, 2016 · Viewed 31.1k times · Source

I have simply no idea on how can I link to another document in the reST file.

I want to link a file named install.rst to my quickstart guide in a paragraph. I don't know how can I achieve this.

Please can you also refer to a great resource from where I can look up syntax for rest. The default quickstart is a little boring and not involves great depth discussion of using rest with sphinx.

The doc in question is : http://todx.rtfd.io

Answer

Ryszard Cetnarski picture Ryszard Cetnarski · Apr 14, 2017

To create links between different reStructuredText (.rst) files you can use the inline markup provided by sphinx. See the documentation under the heading Cross-referencing documents

on top of the file you define its label

.. _my-reference-label:

then you can link to it from other documents using

:ref:`my-reference-label`.

I do not believe you need to use the intersphinx extension, since it is for links between different projects. With this method you can link between different .rst files using their relative paths as described in the documentaion link above.