Internal hyperlinks

Internal hyperlinks make it possible to connect one position to another within a comment. The hyperlink target always points to the subsequent text body element.

Hyperlink reference

Description

The hyperlink reference consists of a reference name followed by an underscore:

reference-name_

Phrase references must be specified in back quotes:

`reference name`_

(See also: Reference names)

Start and end characters

  • No start character, end character = "_"
  • Start character = "`", end character = "`_" (phrase references)

(See also: Inline markup)

Hyperlink target

Description

The hyperlink target consists of an explicit markup start (".. "), an underscore, the reference name and a colon:

.. _reference-name:

A phrase reference in the hyperlink target can optionally be included in back quotes:

.. _`reference name`:
.. _reference name:

(See also: Explicit markup blocks, Reference names)

Principle

+-----+---------------+
|".. "|"_"name":"     |
+-----+               |
      |               |
      +---------------+

Properties

  • Internal hyperlink targets have an empty link block.
  • A blank line is required between the explicit markup block and the subsequent text body element. Blank lines between explicit markup blocks are optional.

Sample

(In sample project: B_DocuElements\Hyperlinks\FB_Libdoc_InternalHyperlinks)

Simple internal hyperlink target

Clicking the hyperlink reference target_ displays the text body element under .. _target: .

(*
Clicking on this internal hyperlink will take us to the target_
below.

.. _target:

The hyperlink targets above point to this paragraph.
*)

Internal hyperlinks 1:

Nesting of internal hyperlink targets

The hyperlink also works if the internal hyperlink target is "nested" in an indented text block. For example, hyperlink targets can be set to individual list elements (with the exception of the first, since a previous internal hyperlink target applies to the entire list):

(*
Clicking on this internal hyperlink will take us to the `third item`_ of the bullet list.

* First list item
* Second list item

  .. _third item:

* Third list item, with hyperlink target.
*)

Internal hyperlinks 2:

Concatenation of internal hyperlink targets

Internal hyperlink targets can be "concatenated". Several neighboring internal hyperlink targets then point to the same element:

(*
Clicking on this internal hyperlink will take us to target1_
and clicking on this internal hyperlink will take us to target2_.
Both targets point the the same paragraph.

.. _target1:
.. _target2:

The targets "target1" and "target2" are synonyms; they both
point to this paragraph.
*)

Internal hyperlinks 3:

Internal hyperlink targets can also be inserted in the current text (see: Inline hyperlinks).