The HTML output formatter
HTML output is the most common usage of AsciidoctorJ and is also bundled with org.asciidoctor.jvm
.
There are a number of items that can be configured on the output formatter itself.
-
Groovy
import org.asciidoctor.gradle.model5.jvm.formatters.AsciidoctorjHtml
asciidoc {
toolchains {
aciidoctorj {
registeredOutputFormatters {
html(AsciidoctorjHtml) { (1)
embedded = true (2)
templateDirs 'src/myAsciidocTemplate1', 'src/myAsciidocTemplate2' (3)
forceEngine = 'erb' (4)
useEngine 'slim' (5)
useEngine 'slim', '1.2.3' (6)
}
}
}
}
}
1 | The org.asciidoctor.jvm plugin adds an HTML output formatter called html . |
2 | Output an embeddable document, which excludes the header, the footer, and everything outside the body of the document. This option is useful for producing documents that can be inserted into an external template. |
3 | Define one or more templates that can be used for conversion. |
4 | Force AsciidoctorJ to use the specific engine irrespective of the extensions detected in the template directories. |
5 | Adds an engine to the GEM classpath.
Only erb , slim and haml is supported. |
6 | Adds any engine by tilt along with the version of the GEM. |
templateDirs must be provided, otherwise template setting will be ignored.
If the engine is not provided, it will auto-detect engines from the file extensions found in the template directories.
|