References / Cross-references

Document writer <olivier.nicolas@insa-lyon.fr>
vxxx, 2022-xx-xx

1. Page / Site cross-references

1.1. Section identifiers / Anchors

Before you can make a reference to a section you will need to prefix it with an
ID that you can then refer to.

1.1.1. code

[#yourID]
==== Code sections
...

1.2. Cross-reference to a section in the current page / module

First, specify a section ID, as explained above.
Then refer to it with it’s ID.

1.2.1. Code

<<yourID>>

1.3. Reference to another module

Considering the following file architecture:

modules
├── links
│   └── pages
│       └── links.adoc
└── tables
   └── pages
       └── tables.adoc

1.3.1. Code

xref:tables:tables.adoc[Go]

1.3.2. Result

1.4. To a section in another module

Same architecture as above:

  • In the "target" module (Here tables), set a tag before the section name. Example:

[#yourID]
== Example 3
  • In the "calling" module (Here lnks), postfix the module page with the previous tag:

1.4.1. Code

xref:tables:tables.adoc#yourID[here]

1.4.2. Result

2. Reference to another website

2.1. Open in current tab

2.1.1. Code

link:https://asciidoctor.org[https://asciidoctor.org]

2.1.2. Result

2.2. Open in new tab

2.2.1. Code

link:https://asciidoctor.org[https://asciidoctor.org, window="_blank"]

2.2.2. Result