Hyperlinks¶
Details¶
reStructuredText supports several types of hyperlink targets as documented in the docutils reference:
External hyperlink targets: Links to external URLs
Internal hyperlink targets: Links to explicit targets within the document
Indirect hyperlink targets: Aliases that point to other targets
Implicit hyperlink targets: Automatically created from section titles
Anonymous hyperlink targets: Targets matched by position using double underscores
Examples¶
External hyperlink targets¶
External hyperlink targets link to URLs outside the document.
https://example.com
`here <https://example.com>`_
Python_
.. _Python: https://python.org
#link("https://example.com")[https://example.com]
#link("https://example.com")[here]
#link("https://python.org")[Python]
Internal hyperlink targets¶
Internal hyperlink targets create anchors within the document that can be referenced.
Clicking on this internal hyperlink will take us to the target_ below.
.. _target:
The hyperlink target above points to this paragraph.
Clicking on this internal hyperlink will take us to the #link(<target>)[target] below.
<target>
The hyperlink target above points to this paragraph.
Indirect hyperlink targets¶
Indirect hyperlink targets are aliases that point to other targets, allowing multiple names for the same destination.
.. _Python: https://www.python.org/
.. _Python DOT ORG: Python_
This is a `Python DOT ORG`_ reference.
This is a #link("https://www.python.org/")[Python DOT ORG] reference.
Anonymous hyperlink targets¶
Anonymous hyperlink targets use double underscores and are matched to references in order of appearance.
See `the web site of my favorite programming language`__.
__ https://www.python.org/
See #link("https://www.python.org/")[the web site of my favorite programming language].
References¶
Docutils:
Typst: