/asciidoctorj-reveal.js

AsciidoctorJ Reveal.js bundles the Asciidoctor Reveal.js RubyGem (asciidoctor-revealjs) so it can be loaded into the JVM using JRuby

Primary LanguageJavaApache License 2.0Apache-2.0

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://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.7.0")
        )
        .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://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.7.0 \
             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://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>