Sphinx: cross-reference indexed item
How can I cross-reference an i开发者_JS百科ndexed 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.
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`
This options still does not seem possible without adding in custom labels. There is an issue open at https://github.com/sphinx-doc/sphinx/issues/1671
It is possible to link to glossary terms using :term:
, and index links ideally would be possible and added to the arbitrary links docs
精彩评论