【发布时间】:2019-11-23 10:40:41
【问题描述】:
我正在使用 Sphinx-RTD 构建文档。
我想在某处有一个链接,并将其样式设置为逐字或预格式化文本。
例如,假设我有这个逐字记录:
ALTER TABLE
有没有办法将它链接到某个地方,比如 :ref:... 或者甚至只是一个标准的超链接?
【问题讨论】:
标签: python-sphinx restructuredtext read-the-docs
我正在使用 Sphinx-RTD 构建文档。
我想在某处有一个链接,并将其样式设置为逐字或预格式化文本。
例如,假设我有这个逐字记录:
ALTER TABLE
有没有办法将它链接到某个地方,比如 :ref:... 或者甚至只是一个标准的超链接?
【问题讨论】:
标签: python-sphinx restructuredtext read-the-docs
如果我没记错的话,"Replacement Text" directive 可以提供帮助。
由于 reStructuredText 不支持嵌套的内联标记,使用样式文本创建引用的唯一方法是使用带有“replace”指令的替换:
I recommend you try |Python|_. .. |Python| replace:: Python, *the* best language around .. _Python: http://www.python.org/
所以可能是这样的:
Click |altertable|_ to read details about |altertable|.
----
Blah blah blah
----
.. _altertable:
Here are the details about |altertable|: blah blah blah.
.. |altertable| replace:: ``ALTER TABLE``
【讨论】: