Sphinx-reST-RTD 中的预格式化(逐字)超链接 [英] Preformatted (verbatim) hyperlink in Sphinx-reST-RTD
问题描述
我正在使用 Sphinx-RTD 构建文档.
I am building documentation with Sphinx-RTD.
我想在某处有一个链接,并被设置为逐字或预先格式化的文本.
I want to have a link somewhere, and be styled as a verbatim or preformatted text.
例如,假设我有这个逐字逐句:
For example, say I have this verbatim:
ALTER TABLE
有没有办法将它链接到某个地方,比如 :ref:...
或者甚至只是一个标准的超链接?
Is there a way to link it somewhere, say a :ref:...
or even just a standard hyperlink?
推荐答案
如果我没记错的话 "替换文本";指令可以提供帮助.
If I am not mistaken the "Replacement Text" directive can help.
由于 reStructuredText 不支持嵌套的内联标记,创建带有样式文本的引用的唯一方法是使用带有replace"的替换指令:
As reStructuredText doesn't support nested inline markup, the only way to create a reference with styled text is to use substitutions with the "replace" directive:
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``
这篇关于Sphinx-reST-RTD 中的预格式化(逐字)超链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!