GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — javaMultiModuleDemo/demo-documentation at master · nicodeur/javaMultiModuleDemo

Expand file tree

/

demo-documentation

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

demo-documentation

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
src/site
src/site
 
 
README.adoc
README.adoc
 
 
pom.xml
pom.xml
 
 

README.adoc

Outline

Asciidoctor Maven Plugin: AsciiDoc Multiple Input Documents Maven Example

An example project that demonstrates how to convert multiple input AsciiDoc documents to HTML5 and PDF using the Asciidoctor Maven plugin.

Usage

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

$ mvn

Open the files target/generated-docs/example-manual.html and target/generated-docs/example-technical-doc.html in your browser to see the generated HTML file.

How does it work?

By defining multiple execution blocks, you can configure different input documents, output formats or various other configuration parameters.

In the example, we define a first execution block as follows:

<execution>
 <id>asciidoc-usermanual-to-pdf</id> (1)
 <phase>generate-resources</phase>
 <goals>
     <goal>process-asciidoc</goal>
 </goals>
 <configuration>
     <sourceDirectory>src/docs/asciidoc/user-manual</sourceDirectory> (2)
     <backend>pdf</backend> (3)
     <!-- Since 1.5.0-alpha.9, PDF back-end can also use 'rouge' which provides more coverage
     for other languages like scala -->
     <sourceHighlighter>coderay</sourceHighlighter>
     <attributes>
         <pagenums/>
         <toc/>
         <idprefix/>
         <idseparator>-</idseparator>
     </attributes>
 </configuration>
</execution>
  1. Define a unique id for your execution block

  2. Define the source directory where the asciidoc source document for the manual is located

  3. Select pdf as the output format

Note

You also need to add a dependency on asciidoctorj-pdf to make export to PDF work:

<dependency>
  <groupId>org.asciidoctor</groupId>
  <artifactId>asciidoctorj-pdf</artifactId>
  <version>1.5.0-alpha.9</version>
</dependency>

The second execution block defines how to create the technical documentation in HTML:

<execution>
    <id>asciidoc-techdocs-to-html</id> (1)
    <phase>generate-resources</phase>
    <goals>
        <goal>process-asciidoc</goal>
    </goals>
    <configuration>
        <sourceDirectory>src/docs/asciidoc/technical-docs</sourceDirectory> (2)
        <backend>html5</backend> (3)
        <sourceHighlighter>coderay</sourceHighlighter>
        <attributes>
            <imagesdir>./images</imagesdir>
            <toc>left</toc>
            <icons>font</icons>
            <sectanchors>true</sectanchors>
            <!-- set the idprefix to blank -->
            <idprefix/>
            <idseparator>-</idseparator>
            <docinfo1>true</docinfo1>
        </attributes>
    </configuration>
</execution>
  1. Define a unique id for your execution block. Make sure it is different from the other execution block(s)

  2. Define the source directory where the asciidoc source document for the technical docs is located

  3. Select html5 as the output format

You can of course define as many execution blocks as wanted.

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.