reST:具有任意标题的内联链接?
如果我定义了内部超链接目标,如何使用任意文本作为链接标题链接到它?
例如:
_`This is a very long internal link target`. ... A `short reference`_ to the very long link target.
如何将“短参考”目标变成“非常长的内部目标”?
编辑:另一个例子:
Widgets ======= ... Use a `widget`_.
如何将“widget”(单数)链接到“Widgets”(复数)标题?
(当然,我意识到这可以使用 `widget`_\s
来完成......但这并不能解决一般问题)
If I've defined an internal hyperlink target, how can I link to it using arbitrary text as the link title?
For example:
_`This is a very long internal link target`. ... A `short reference`_ to the very long link target.
How could I make the “short reference” target the “very long internal target”?
Edit: Another example:
Widgets ======= ... Use a `widget`_.
How can I make “widget” (singular) link to the “Widgets” (plural) heading?
(of course, I realize that this could be done using `widget`_\s
… But that doesn't solve the general problem)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我还没有找到使用“标准”休息来做到这一点的方法。但使用 Sphinx 时,可以执行以下操作:
I haven't found a way to do this using "standard" reST. But with Sphinx, the following works:
很好,mzjn 的答案也适用于课程:
万岁!
Nicely, mzjn's answer also works for classes:
Hurray!
pure-reStructuredText 方法是为同一个目标定义多个目标名称:(
此方法的一个限制是您可能希望对两个使用相同的文本(例如“above”)不同的位置,在这种情况下上述方法失败。)
A pure-reStructuredText method is to define multiple target names for the same target:
(A limitation of this approach is that you may want to use the same text (e.g. "above") for two different locations, and the approach above fails in this case.)