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://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.7.0")
)
.get()
);
Using the CLI you can create slides with this call:
asciidoctorj --classpath ..asciidoctor-revealjs.jar \
-b revealjs \
-a revealjsdir=https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.7.0 \
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://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.7.0
</revealjsdir>
</attributes>
</configuration>
<dependencies>
<dependency>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctorj</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctorj-revealjs</artifactId>
<version>3.1.0-rc.1</version>
</dependency>
</dependencies>
</plugin>