Python sphinx 在StructuredText中,如何将内联文本放入超链接中?

Python sphinx 在StructuredText中,如何将内联文本放入超链接中?,python-sphinx,restructuredtext,Python Sphinx,Restructuredtext,在我的StructuredText文档中,我有一个这样定义的部分: Update the ``PATH`` Environment Variable ---------------------------------------- 我想这样链接到本节: * `Update the ``PATH`` Environment Variable`_ 但是,当此代码呈现为HTML时,结果如下所示: 更新``PATH`环境变量` 我确实希望环境变量PATH以文字样式出现,但我对这一点非常陌生。有人

在我的StructuredText文档中,我有一个这样定义的部分:

Update the ``PATH`` Environment Variable
----------------------------------------
我想这样链接到本节:

* `Update the ``PATH`` Environment Variable`_
但是,当此代码呈现为HTML时,结果如下所示:

  • 更新``PATH`环境变量`
我确实希望环境变量
PATH
以文字样式出现,但我对这一点非常陌生。有人能帮我吗?

摘自:

如果将标签直接放在章节标题之前,则可以使用
:ref:`label name`
对其进行引用

例如:

.. _my-reference-label:

Section to cross-reference
--------------------------

This is the text of the section.

It refers to the section itself, see :ref:`my-reference-label`.
有了a,是的——这是可能的(从@mzjn的提示)

例如:

.. |dummy| replace:: Update the ``PATH`` Environment Variable
.. _dummy:

Update the ``PATH`` Environment Variable
----------------------------------------

* |dummy|_

这是通过利用来实现的。

我想不出解决这个问题的方法。嵌套内联标记是一个问题。看见