AsciidoctorJ Reveal.js is a convenient repackaging of Asciidoctor Reveal.js for use with AsciidoctorJ, which brings the Asciidoctor ecosystem to the JVM.
To create slides programmatically using the AsciidoctorJ API use the following code:
Asciidoctor asciidoctor = Asciidoctor.Factory.create();
asciidoctor.requireLibrary("asciidoctor-revealjs");
asciidoctor.convertFile(new File("document.adoc"),
options()
.backend("revealjs")
.safe(SafeMode.UNSAFE)
.attributes(
AttributesBuilder.attributes()
.attribute("revealjsdir", "https://cdn.jsdelivr.net/npm/reveal.js@4.3.1")
)
.get()
);
Using the CLI you can create slides with this call:
asciidoctorj --classpath ..asciidoctor-revealjs.jar \
-b revealjs \
-a revealjsdir=https://cdn.jsdelivr.net/npm/reveal.js@4.3.1 \
document.adoc
To create slides using the Asciidoctor Maven Plugin you can use the following plugin configuration:
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
<version>2.0.0-RC.1</version>
<configuration>
<backend>revealjs</backend>
<requires>
<require>asciidoctor-revealjs</require>
</requires>
<attributes>
<revealjsdir>
https://cdn.jsdelivr.net/npm/reveal.js@4.3.1
</revealjsdir>
</attributes>
</configuration>
<dependencies>
<dependency>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctorj</artifactId>
<version>2.4.3</version>
</dependency>
<dependency>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctorj-revealjs</artifactId>
<version>4.0.1</version>
</dependency>
</dependencies>
</plugin>