如何交叉引用 reStructuredText 文档中的索引项?
例如,我如何交叉引用 SectionB:
.. index::
pair: SectionA; SectionB
SectionB
--------
SectionB description.
我尝试在引用中使用索引标签,例如:
:ref:`SectionB`
但这不起作用。
如何交叉引用 reStructuredText 文档中的索引项?
例如,我如何交叉引用 SectionB:
.. index::
pair: SectionA; SectionB
SectionB
--------
SectionB description.
我尝试在引用中使用索引标签,例如:
:ref:`SectionB`
但这不起作用。
请参阅:交叉引用任意位置
在狮身人面像文档中。
我认为您可能缺少的是参考标签,
尝试类似:
.. index::
pair: SectionA; SectionB
.. _section-b-label:
SectionB
--------
SectionB description.
然后在其他地方做:
:ref:`section-b-label`
如果不添加自定义标签,这个选项似乎仍然是不可能的。https://github.com/sphinx-doc/sphinx/issues/1671有一个问题未解决
可以使用 链接到词汇表术语:term:
,理想情况下可以使用索引链接并将其添加到任意链接文档中