Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sphinx: cross-reference indexed item

How can I cross-reference an indexed item inside a reStructuredText document?

For example, how can I cross-reference SectionB:

.. index::
    pair: SectionA; SectionB

SectionB
--------

SectionB description.

I tried using the index labels in references, such as:

:ref:`SectionB`

but this does not work.

like image 809
Unbeknown Avatar asked Mar 19 '10 18:03

Unbeknown


1 Answers

see: Cross-referencing arbitrary locations

in the Sphinx documentation.

I think what you might be missing is a reference label,

Try something like:

.. index::
pair: SectionA; SectionB

.. _section-b-label:

SectionB
--------

SectionB description.

and then elsewhere do:

:ref:`section-b-label`
like image 145
Kevin Horn Avatar answered Sep 25 '22 11:09

Kevin Horn