Local Antora Plugin
Objectives
local-antora
Gradle plugin aims to:-
generate Antora docs locally without adding a playbook
-
sensible defaults
-
work seamlessly with the
local-kroki
plugin
The Bootstrap Antora Task can help with the initial Antora structure. |
About Antora
Antora is a documentation site generator for AsciiDoc. It’s pretty neat. Check out the Antora Docs to learn more.
This Gradle plugin aims to let you generate a site without having to care too much about how it actually works.
How It Works
The local-antora
Gradle plugin applies the gradle-node-plugin and sets
up the configuration for an Antora build.
It will also react to the presence of the local-kroki
plugin
and configure Antora to use the local instance of Kroki.
-
adds the
localAntora
extension -
applies the gradle-node-plugin
-
adds the
writePackageJsonFile
task, writes apackage.json
* file (to the project directory) -
adds the
writeAntoraPlaybookFile
tasks, writes aplaybook.yml
* file (to thebuild
director) -
adds the
generateLocalAntoraSite
task
package.json
writePackageJsonFile
task will:-
add scripts to install and run Antora
-
add dependencies on Antora
-
add dependencies on Antora extensions
-
defaults:
asciidoctor-kroki
andasciidoctor-mathjax
-
playbook.yml
writeAntoraPlaybook
will automatically:-
add
title
-
add
start_page
-
locate the Git root as
content.url
-
discover all
antora.yml
files and add relativestart_paths
-
add
HEAD
asbranches
-
add
asciidoc.extensions
-
configure the attribute for
kroki-server-url
-
configure the attribute for
kroki-fetch-diagram
-
add convenience
asciidoc.attributes
-
add any user defined
asciidoc.attributes
(default empty) -
configure
ui.bundle.url
-
configure
ui.supplemental_files
(defaultnull
)
Setup
plugins {
id 'com.gitlab.mvik.local-antora' version '0.4.0'
}
// configure
localAntora {
downloadNode true
antoraVersion '^3.0.0-alpha.1'
kroki {
}
playbook {
uiBundleUrl 'https://your.org/custom-bundle.zip'
outputSiteDir layout.buildDirectory.dir('antora-site')
}
playbookFile layout.buildDirectory.file('antora/playbook.yml')
}
See More Examples to get the full list of configuration options.
Run Antora
./gradlew nodeSetup nmpInstall
./gradlew generateLocalAntoraSite
More Examples
See use plugin examples in the source repository.