4

I'm generating documentation with Sphinx. I can change the label of links to documents in the table of contents with

Features </resources/pages/features>

in the toctree directive as per the toctree directive, but how can I do the same for links to sections within a document?

EDIT :

This is what I would like to achieve :

doc.rst

.. toctree::
    :maxdepth: 2

    Section - Information <info>

.. _info:

Info Section
------------

So that Section - information would appear in the table of contents but Info section would appear in the document itself

bad_coder
  • 11,289
  • 20
  • 44
  • 72
jfoucher
  • 2,251
  • 2
  • 21
  • 29

1 Answers1

0

I believe you can use standard reST labels.

Example:

pages/features.rst:

.. _label1:

A section
---------

Some text

otherpage.rst:

See :ref:`label1`

Cross-referencing arbitrary locations.

codeape
  • 97,830
  • 24
  • 159
  • 188