reST:与任意标题的内联链接? [英] reST: inline links with arbitrary titles?

查看:130
本文介绍了reST:与任意标题的内联链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我已经定义了一个内部超链接目标,那么如何使用任意文本链接到链接标题?

If I've defined an internal hyperlink target, how can I link to it using arbitrary text as the link title?

例如:


_`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"?

修改:另一个例子:


Widgets
=======

...

Use a `widget`_.

如何使widget(单数)链接到Widgets(复数)标题?

How can I make "widget" (singular) link to the "Widgets" (plural) heading?

(当然,我意识到这可以使用`widget`_\s ...但是这并不能解决一般问题)

(of course, I realize that this could be done using `widget`_\s… But that doesn't solve the general problem)

推荐答案

我没有找到一种方法来使用standardreST。但是,狮身人面像,以下作品:

I haven't found a way to do this using "standard" reST. But with Sphinx, the following works:

.. _`This is a very long internal link target`:

:ref:`Short reference <This is a very long internal link target>` to the very long link target.

这篇关于reST:与任意标题的内联链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆