Skip to content

Latest commit

 

History

History
40 lines (30 loc) · 1.74 KB

File metadata and controls

40 lines (30 loc) · 1.74 KB

Asciidoctor Maven Plugin: Asciidoctor Diagram Example

An example project that demonstrates how to integrate Asciidoctor Diagram with the Asciidoctor Maven plugin.

Usage

Convert the AsciiDoc to HTML5 by invoking the process-resources goal (configured as the default goal):

$ mvn

Open the file target/generated-docs/example-manual.html in your browser to see the generated HTML file containing the generated diagram images.

Graphviz configuration

Asciidoctor Diagram bundles both the ditaa and PlantUML libraries and will use them to generate diagrams. In order to generate diagrams using Graphviz, you must install it separately. There are two options to reference the installed Graphviz’s dot tool in order to generate diagrams: system’s PATH or plug-in attributes configuration.

Configuration via system’s PATH

Visit Graphviz' site for details on how to install the dot command tool, and to make the dot command available on your system’s PATH.

Configuration via plug-in attributes

Once Graphviz binaries from the Graphviz' site are available on the system, the plug-in attributes in the pom.xml can be used to reference to the dot tool directly. This type of configuration may be especially useful when working in a CI environment. Example:

<plugin>
    <groupId>org.asciidoctor</groupId>
    <artifactId>asciidoctor-maven-plugin</artifactId>
    ...
    <configuration>
        <attributes>
            <graphvizdot>/PATH/TO/Graphviz/bin/dot</graphvizdot>
        </attributes>
        ...

References

For more examples and information about Asciidoctor Diagrams see http://asciidoctor.org/news/2014/02/18/plain-text-diagrams-in-asciidoctor/