Adding a cross-reference to a subheading or anchor in another page

后端 未结 4 2044
-上瘾入骨i
-上瘾入骨i 2020-12-04 10:37

How to insert a cross-reference in a reST/Sphinx page to either a sub-header or anchor in another page in the same documentation set?

4条回答
  •  旧时难觅i
    2020-12-04 11:20

    In Sphinx 3.0.3 the only solution that worked for me is :any: (see https://www.sphinx-doc.org/en/1.5/markup/inline.html#cross-referencing-anything). Suppose, one document has such a section:

    ... _my-section:
    
    My Section
    ----------
    
    Lorem ipsum blablabla
    

    Then another document can have the following fragment to create a link:

    See :any:`my-section` for the details
    

提交回复
热议问题