Include a Page
In Antora, the AsciiDoc include directive has been configured to include another page or portion of a page into the current page. You can include a page from anywhere in the site, including pages from other docs components.
AsciiDoc include directive
Example 1 shows the structure of an include directive with a page’s fully qualified resource ID.
Let’s break down the AsciiDoc syntax and resource ID coordinates you need to include a page resource into a page.
The steps below assume that the target page and current page belong to the same component version and module, so only the page$ and resource coordinates of the target page resource are entered in the resource ID.
On a new line, enter the name of the directive followed by two colons,
Enter the resource ID of the target page file. The resource ID must specify the
page$family coordinate since the include directive is also used to insert files from other families.
Close the directive with a set of square brackets (
The brackets can contain an optional list of attributes. The attributes are entered as key-value pairs separated by commas.
Antora supports filtering the lines of an include file by either line numbers using the
lines attribute or tags using the
Filtering by line numbers takes precedence.
See the Asciidoctor documentation for full details of the
Include a page using a relative path
On a new line, enter the name of the directive followed by two colons.
Next, enter the relative path of the target page in the target slot. A relative path include is resolved from the current page (not the root of the pages family). The relative path must be prefixed with
You may find that the relative path works without this prefix, but that could change in the future.
Close the directive using a set of square brackets (
The brackets may contain an optional list of attributes. Attributes are entered as key-value pairs separated by commas.
All the attributes (e.g.,
indent) on the include directive are supported.