Skip to content

Latest commit

 

History

History
105 lines (92 loc) · 3.31 KB

README.adoc

File metadata and controls

105 lines (92 loc) · 3.31 KB

AsciidoctorJ Reveal.js: Asciidoctor

AsciidoctorJ Reveal.js is a convenient repackaging of Asciidoctor Reveal.js for use with AsciidoctorJ, which brings the Asciidoctor ecosystem to the JVM.

Creating slides using the AsciidoctorJ API

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/[email protected]")
        )
        .get()
);

Creating slides using the AsciidoctorJ CLI

Using the CLI you can create slides with this call:

asciidoctorj --classpath ..asciidoctor-revealjs.jar \
             -b revealjs \
             -a revealjsdir=https://cdn.jsdelivr.net/npm/[email protected] \
             document.adoc

Creating slides with the Asciidoctor Maven Plugin

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/[email protected]
      </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>