如何在Sphinx文档中创建内部链接
如何在Sphinx文档中创建内部链接?我正在使用:
:role:`target`
但是它没有效果。
2 个回答
4
在某个地方有个标题,
.. _HeaderTag:
Header
------
参考上面的标题(可能不是同一个文件)
:ref:`HeaderTag`
# or with custom text
:ref:`custom header<HeaderTag>`
36
交叉引用是通过一个叫做 ref
的东西来实现的。
:ref:`label-name`
你可以通过以下方式来提供你的标签:
.. _label-name:
查看: https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-ref
角色用于创建自定义的解释文本。查看: http://docutils.sourceforge.net/docs/ref/rst/directives.html#role