Skip to content

Commit 6e8ffcb

Browse files
committed
feat: antora-cpp-tagfiles-extension coordination
1 parent 600961c commit 6e8ffcb

10 files changed

Lines changed: 502 additions & 25 deletions

File tree

README.adoc

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Install this extension
1212

1313
[source,bash]
1414
----
15-
npm i -D @alandefreitas/antora-cpp-reference-extension
15+
npm i -D @cppalliance/antora-cpp-reference-extension
1616
----
1717

1818
=== Requirements
@@ -31,7 +31,7 @@ Append the following in your `playbook.yaml`:
3131
----
3232
antora:
3333
extensions:
34-
- require: '@alandefreitas/antora-cpp-reference-extension' # <1>
34+
- require: '@cppalliance/antora-cpp-reference-extension' # <1>
3535
dependencies: # <2>
3636
- name: 'boost'
3737
repo: 'https://github.com/boostorg/boost.git'
@@ -40,9 +40,12 @@ antora:
4040
system-env: 'BOOST_SRC_ROOT' # <3>
4141
----
4242

43-
* <1> `npm` package name: `@alandefreitas/antora-cpp-reference-extension` (required)
44-
* <2> List of dependencies to be downloaded and extracted. The directory where these dependencies are extracted will be available to all components as an environment variable.
45-
* <3> The name of the environment variable describing where the path can be found. If this path exists and is a valid directory, it will be used as the source root for the dependency, skipping the download and extraction steps. If this is different from `variable`, the extension will set the value of `variable` to the path where the dependency is already located.
43+
* <1> `npm` package name: `@cppalliance/antora-cpp-reference-extension` (required)
44+
* <2> List of dependencies to be downloaded and extracted.
45+
The directory where these dependencies are extracted will be available to all components as an environment variable.
46+
* <3> The name of the environment variable describing where the path can be found.
47+
If this path exists and is a valid directory, it will be used as the source root for the dependency, skipping the download and extraction steps.
48+
If this is different from `variable`, the extension will set the value of `variable` to the path where the dependency is already located.
4649

4750
Besides the `dependencies` configuration, you can also set the following options:
4851

@@ -52,20 +55,24 @@ Besides the `dependencies` configuration, you can also set the following options
5255
| `version` | A semver range that specifies the version of MrDocs to use. | `*`
5356
| `allow-master` | If `true`, the extension will allow the use of the `master` branch for MrDocs if `version` is `*`. | `true`
5457
| `allow-develop` | If `true`, the extension will allow the use of the `develop` branch for MrDocs if `version` is `*`. | `true`
58+
| `module` | Antora module that will receive the generated pages (`modules/<module>/pages`). | `reference`
5559
|===
5660

5761
=== Components
5862

59-
Components that will include reference documentation should set the path of the MrDocs configuration file. Append following in your `antora.yaml`:
63+
Components that will include reference documentation should set the path of the MrDocs configuration file.
64+
Append following in your `antora.yaml`:
6065

6166
[source,yaml]
6267
----
6368
ext:
6469
cpp-reference:
6570
config: doc/mrdocs.yml # <1>
71+
module: api-ref # <2>
6672
----
6773

6874
* <1> The path to the MrDocs configuration file relative to the worktree.
75+
* <2> (Optional) Override the Antora module used for the generated pages. If omitted the component inherits the module set at the playbook level (or `reference` when neither level specifies a value).
6976

7077
For more information about MrDocs, see https://www.mrdocs.com/docs
7178

@@ -80,6 +87,20 @@ You would usually include a link to the main reference page in the component's `
8087
* xref:reference:index.adoc[Reference]
8188
----
8289

90+
=== Coordinating with the tagfiles extension
91+
92+
When the tagfiles extension (https://github.com/cppalliance/antora-cpp-tagfiles-extension) is also listed in your playbook, the reference tagfile is registered automatically and picked up within the same Antora run—even if you change the module name.
93+
94+
[source,yaml]
95+
----
96+
antora:
97+
extensions:
98+
- require: '@cppalliance/antora-cpp-reference-extension'
99+
- require: '@cppalliance/antora-cpp-tagfiles-extension'
100+
----
101+
102+
With this configuration, you don't need to copy tagfiles into your repository or commit them to source control to satisfy `cpp:` macros.
103+
83104
== Example
84105

85106
The `example` directory contains an example project with a component that uses the extension.

0 commit comments

Comments
 (0)