forkme right red aa0000

About

This repository contains examples on how to use Gradle and Asciidoctor to create html5, pdf, epub, deck.js, and reveal.js outputs.

1. Diagrams HTML Example

An example project that demonstrates how to convert AsciiDoc with diagrams to HTML5 using the Asciidoctor Gradle plugin.

1.1. Usage

Convert the AsciiDoc to HTML5 by invoking the 'asciidoctor' goal:

$ ./gradlew asciidoctor

Open the file build/asciidoc/html/example-manual.html in your browser to see the generated HTML file.

1.2. Source

1.3. Outputs

2. HTML, PDF, & epub3 Example

An example project that demonstrates how to convert AsciiDoc to HTML, PDF, & epub3 using the Asciidoctor Gradle plugin.

2.1. Usage

Convert the AsciiDoc to HTML, PDF, & epub3 by invoking the 'asciidoctor' goal:

$ ./gradlew asciidoctor

Open the file build/asciidoc/epub3/example-manual.epub in your browser to see the generated epub file.

Open the file build/asciidoc/html5/example-manual.html in your browser to see the generated HTML file.

Open the file build/asciidoc/pdf/example-manual.pdf in your browser to see the generated PDF file.

2.2. Source

2.3. Outputs

3. deck.js Example

An example project that demonstrates how to convert AsciiDoc to deck.js using the Asciidoctor Gradle plugin.

3.1. Usage

Convert the AsciiDoc to deck.js by invoking the 'asciidoctor' goal:

$ ./gradlew clean asciidoctor

3.2. IntelliJ

If you’re using IntelliJ you can generate the IDE’s files via:

$ ./gradlew idea

Open the file build/asciidoc/deckjs/example-manual.html in your browser to see the generated deckjs file.

3.3. Source

3.4. Outputs

4. epub3 Example

An example project that demonstrates how to convert AsciiDoc to epub3 using the Asciidoctor Gradle plugin.

4.1. Usage

Convert the AsciiDoc to epub3 by invoking the 'asciidoctor' goal:

$ ./gradlew asciidoctor

Open the file build/asciidoc/epub3/example-manual.epub in your browser to see the generated epub3 file.

4.2. Source

4.3. Outputs

5. HTML Example

An example project that demonstrates how to convert AsciiDoc to HTML5 using the Asciidoctor Gradle plugin.

5.1. Usage

Convert the AsciiDoc to HTML5 by invoking the 'asciidoctor' goal:

$ ./gradlew asciidoctor

Open the file build/asciidoc/html/example-manual.html in your browser to see the generated HTML file.

5.2. Source

5.3. Outputs

6. LiveReload HTML Example

An example project that demonstrates how to convert AsciiDoc to HTML5 using the Asciidoctor Gradle plugin with Live Reload support.

6.1. Usage

Convert the AsciiDoc to HTML5 by invoking the 'asciidoctor' goal:

$ ./gradlew asciidoctor

Open the file build/asciidoc/html/example-manual.html in your browser to see the generated HTML file.

6.2. Live Reload Support

The Gradle build also can support Live Reload

Start by running the build with the watch task

$ ./gradlew asciidoctor watch

This ensures if you modify example-manual.adoc then everything is rebuilt.

Open another terminal and run the liveReload task:

$ ./gradlew liveReload

Now you can use the Chrome or Firefox plugins to automatically reload your browser when the build completes.

After installing the Chrome LiveReload extension, you need to check the "Allow access to file URLs" checkbox in Tools > Extensions > LiveReload in order for it to work with local files.

Now try editing example-manual.adoc and watching your browser. After a brief wait you will observe that the browser is automatically updated with your changes.

6.3. Source

6.4. Outputs

7. PDF Example

An example project that demonstrates how to convert AsciiDoc to PDF using the Asciidoctor Gradle plugin.

7.1. Usage

Convert the AsciiDoc to PDF by invoking the 'asciidoctor' goal:

$ ./gradlew asciidoctor

Open the file build/asciidoc/pdf/example-manual.pdf in your browser to see the generated PDF file.

7.2. Source

7.3. Outputs

8. reveal.js Example

An example project that demonstrates how to convert AsciiDoc to reveal.js using the Asciidoctor Gradle plugin.

8.1. Usage

Convert the AsciiDoc to reveal.js by invoking the 'asciidoctor' goal:

$ ./gradlew clean asciidoctor

8.2. IntelliJ

If you’re using IntelliJ you can generate the IDE’s files via:

$ ./gradlew idea

Open the file build/asciidoc/reveal/example-manual.html in your browser to see the generated revealjs file.

8.3. Source

8.4. Outputs