@neo4j-antora/selector-labels v0.1.1
selector-labels
Use the selector-labels extension to add text to component versions in the version selector.
Usage
- Install the extension:
npm i @neo4j-antora/selector-labels Add the extension in a playbook
antora: extensions: - require: "@neo4j-antora/selector-labels.js"Add
lts: trueto a component descriptor file (antora.yml). The ui-bundle will display the corresponding text,(LTS)after the component name and version in the version selector for LTS releases, and(Current)for the latest release.
Note that by default the latest release is determined using Antora's semantic version ordering rules. If you want to override this behaviour and manually mark a version as current you can do this by adding
current: trueto antora.yml and providing your own extension config in the playbook. In the config, includecurrent:and setuse_semantic: falseto prevent the latest version (as determined by Antora) from automatically being labeled as the current version.
Config
You can define a custom list of attributes in the playbook.
If you do not define any attributes, the default values are used. The default values are equivalent to adding the following to the playbook:
antora:
extensions:
- require: "@neo4j-antora/selector-labels.js"
current:
selector_text: '(Current)'
unique: true
use_semantic: true
lts:
selector_text: '(LTS)'In the default configuration, text is added in the version selector, after the component name and version, to 'Current' and 'LTS' releases.
By default, current is given the attribute value unique: true, meaning that for a given component, only one version can be considered 'Current'. An error is logged for a component if more than one version has a unique attribute defined in its antora.yml file. The extension uses Antora's semantic version ordering rules to determine the latest version to mark as 'current'.
Using the CLI to add the extension
Although you will usually want to add the extension to a playbook, you can add it by using the Antora CLI.
You can do this with the --extension option:
--extension <PATH TO EXTENSION>