summaryrefslogtreecommitdiff
path: root/sphinx/ext/extlinks.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2022-03-19 22:58:15 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2022-03-19 22:58:15 +0900
commitaa1bc83c2ac9357b39048b555c3fdb0efff3449c (patch)
treec1149670ca18b5f9820505322d5b0a5832395ea4 /sphinx/ext/extlinks.py
parent759a526b12213c59d6ae4c8f66682f4328b764f4 (diff)
parent017ef6118b4fe588140266ad6ff2393cbddd9137 (diff)
downloadsphinx-git-aa1bc83c2ac9357b39048b555c3fdb0efff3449c.tar.gz
Merge branch '4.x'
Diffstat (limited to 'sphinx/ext/extlinks.py')
-rw-r--r--sphinx/ext/extlinks.py30
1 files changed, 11 insertions, 19 deletions
diff --git a/sphinx/ext/extlinks.py b/sphinx/ext/extlinks.py
index dae407cfb..97c4cfe87 100644
--- a/sphinx/ext/extlinks.py
+++ b/sphinx/ext/extlinks.py
@@ -1,28 +1,20 @@
-"""
- sphinx.ext.extlinks
- ~~~~~~~~~~~~~~~~~~~
-
- Extension to save typing and prevent hard-coding of base URLs in the reST
- files.
-
- This adds a new config value called ``extlinks`` that is created like this::
+"""Extension to save typing and prevent hard-coding of base URLs in reST files.
- extlinks = {'exmpl': ('https://example.invalid/%s.html', caption), ...}
+This adds a new config value called ``extlinks`` that is created like this::
- Now you can use e.g. :exmpl:`foo` in your documents. This will create a
- link to ``https://example.invalid/foo.html``. The link caption depends on
- the *caption* value given:
+ extlinks = {'exmpl': ('https://example.invalid/%s.html', caption), ...}
- - If it is ``None``, the caption will be the full URL.
- - If it is a string, it must contain ``%s`` exactly once. In this case the
- caption will be *caption* with the role content substituted for ``%s``.
+Now you can use e.g. :exmpl:`foo` in your documents. This will create a
+link to ``https://example.invalid/foo.html``. The link caption depends on
+the *caption* value given:
- You can also give an explicit caption, e.g. :exmpl:`Foo <foo>`.
+- If it is ``None``, the caption will be the full URL.
+- If it is a string, it must contain ``%s`` exactly once. In this case the
+ caption will be *caption* with the role content substituted for ``%s``.
- Both, the url string and the caption string must escape ``%`` as ``%%``.
+You can also give an explicit caption, e.g. :exmpl:`Foo <foo>`.
- :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
- :license: BSD, see LICENSE for details.
+Both, the url string and the caption string must escape ``%`` as ``%%``.
"""
import re