Version 0.2 | Published 03/03/2013
 

This plug-in allows you to generate documnetation with various file format using Asciidoc source file.

Setting Maven repository

Room Work eXperience repository must be added to use Asciidoc Plugin.

<repositories>
  <repository>
    <url>http://maven.r-w-x.net/releases</url>
    <id>rwx</id>
  </repository>
</repositories>

<pluginRepositories>
  <pluginRepository>
    <id>rwx</id>
    <name>Room Work Plugin Repository</name>
    <url>http://maven.r-w-x.net/releases</url>
    <layout>default</layout>
    <snapshots>
      <enabled>false</enabled>
    </snapshots>
    <releases>
      <updatePolicy>never</updatePolicy>
    </releases>
  </pluginRepository>
</pluginRepositories>

Setting documents

Documents to generate must be set in the plugin configuration

<plugin>
  <groupId>net.rwx.asciidoc</groupId>
  <artifactId>asciidoc-maven-plugin</artifactId>
  <configuration>
    <defaultBackend>pdf</defaultBackend>
    <defaultDocumentType>article</defaultDocumentType>
    <documents>
      <document>
        <title>Asciidoc Article Template</title>
        <path>article.txt</path>
        <backend>html5</backend>
      </document>
    </documents>
  </configuration>
</plugin>

Setting backend

Backend defines target format for documentation. defaultBackend is used to define default backend for every documents to generate. Each document configuration can override this value using backend.

Supported backends are :

html5Generates HTML 5 markup
xhtml11Generates XHTML 1.1 markup styled with CSS2. Output files have an .html extension.
html4Generates plain HTML 4.01 Transitional markup.
slidyGenerates self-contained Slidy HTML slideshows for your web browser.
docbookGenerates DocBook XML 4.5 markup.
pdfGenerates PDF document using FOP transformation

More information on Asciidoc document type can be found on Asciidoc site.

Setting document type

Document type defines how to interpret Asciidoc source file. defaultDocumentType is used to define document type for every documents to generates. Each document configuration can override this value using documentType.

  • article : is used for short document.
  • book : is used to generates a document with multi-part and specific sections.

More information on Asciidoc document type can be found on Asciidoc site.

Generate documents

Like other plugins, to run the Asciidoc plugin, you use:

mvn asciidoc:asciidoc