The Antora Collector extension augments the content aggregation capabilities of Antora by allowing you to delegate to external commands that generate content and to import additional files into the content aggregate.
The Antora Collector extension allows you to designate zero or more external commands (e.g., gradlew generateContent
) per content root that generate transient metadata or content within the context of the worktree for a git reference.
The extension then scans for and imports files from specified directories into the content aggregate (and, in turn, the content catalog).
Use the following command to install the extension into your playbook project:
$ npm i @antora/collector-extension
Open your Antora playbook file and register the extension as an entry in the antora.extensions
key.
If this key doesn’t yet exist in your playbook, first create it.
antora-playbook.yml
antora:
extensions:
- '@antora/collector-extension'
To configure the extension, you must define at least one run/scan operation under the ext.collector
key in a component descriptor.
antora.yml
name: my-project
version: true
# ...
ext:
collector:
run:
command: node generate-files.js
scan:
dir: build/generated-files
Copyright (C) 2022-present by OpenDevise Inc. and the individual contributors of this project.
Use of this software is granted under the terms of the Mozilla Public License Version 2.0 (MPL-2.0).