Skip to content

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

License

Notifications You must be signed in to change notification settings

asciidoctor/asciidoctorj-reveal.js

Repository files navigation

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/reveal.js@4.3.1")
        )
        .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/reveal.js@4.3.1 \
             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/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>

About

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

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages