Ability to link to other pages from plugin docs (#37009)
Support relative links
This commit is contained in:
parent
7016b3b9ca
commit
985f09270d
2 changed files with 5 additions and 0 deletions
|
@ -75,6 +75,7 @@ _ITALIC = re.compile(r"I\(([^)]+)\)")
|
||||||
_BOLD = re.compile(r"B\(([^)]+)\)")
|
_BOLD = re.compile(r"B\(([^)]+)\)")
|
||||||
_MODULE = re.compile(r"M\(([^)]+)\)")
|
_MODULE = re.compile(r"M\(([^)]+)\)")
|
||||||
_URL = re.compile(r"U\(([^)]+)\)")
|
_URL = re.compile(r"U\(([^)]+)\)")
|
||||||
|
_LINK = re.compile(r"L\(([^)]+),([^)]+)\)")
|
||||||
_CONST = re.compile(r"C\(([^)]+)\)")
|
_CONST = re.compile(r"C\(([^)]+)\)")
|
||||||
|
|
||||||
DEPRECATED = b" (D)"
|
DEPRECATED = b" (D)"
|
||||||
|
@ -90,6 +91,7 @@ def rst_ify(text):
|
||||||
t = _ITALIC.sub(r"*\1*", text)
|
t = _ITALIC.sub(r"*\1*", text)
|
||||||
t = _BOLD.sub(r"**\1**", t)
|
t = _BOLD.sub(r"**\1**", t)
|
||||||
t = _MODULE.sub(r":ref:`\1 <\1>`", t)
|
t = _MODULE.sub(r":ref:`\1 <\1>`", t)
|
||||||
|
t = _LINK.sub(r"`\1 <\2>`_", t)
|
||||||
t = _URL.sub(r"\1", t)
|
t = _URL.sub(r"\1", t)
|
||||||
t = _CONST.sub(r"`\1`", t)
|
t = _CONST.sub(r"`\1`", t)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
@ -109,6 +111,7 @@ def html_ify(text):
|
||||||
t = _BOLD.sub(r"<b>\1</b>", t)
|
t = _BOLD.sub(r"<b>\1</b>", t)
|
||||||
t = _MODULE.sub(r"<span class='module'>\1</span>", t)
|
t = _MODULE.sub(r"<span class='module'>\1</span>", t)
|
||||||
t = _URL.sub(r"<a href='\1'>\1</a>", t)
|
t = _URL.sub(r"<a href='\1'>\1</a>", t)
|
||||||
|
t = _LINK.sub(r"<a href='\2'>\1</a>", t)
|
||||||
t = _CONST.sub(r"<code>\1</code>", t)
|
t = _CONST.sub(r"<code>\1</code>", t)
|
||||||
|
|
||||||
return t
|
return t
|
||||||
|
|
|
@ -407,6 +407,8 @@ Example usage::
|
||||||
See also M(win_copy) or M(win_template).
|
See also M(win_copy) or M(win_template).
|
||||||
...
|
...
|
||||||
See U(https://www.ansible.com/tower) for an overview.
|
See U(https://www.ansible.com/tower) for an overview.
|
||||||
|
...
|
||||||
|
See L(IOS Platform Options guide, ../network/user_guide/platform_ios.html)
|
||||||
|
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
Loading…
Reference in a new issue