This repository contains a collection of sample projects that demonstrate numerous ways to use the Asciidoctor Maven plugin in a Maven project.
Clone the example repository using git:
$ git clone https://github.com/asciidoctor/asciidoctor-maven-examples
Refer to the README file in each individual project to learn how to run it.
- asciidoc-to-html-example (aka “The Quickstart”)
-
Demonstrates how to convert AsciiDoc to HTML5 using the Asciidoctor Maven plugin.
- asciidoc-to-html-multipage-example
-
Demonstrates how to convert AsciiDoc to multiple HTML pages with the Asciidoctor Maven plugin and Asciidoctor Multipage Extension.
- docbook-pipeline-docbkx-example
-
Demonstrates how to convert AsciiDoc to DocBook and feed it to the DocBook pipeline to generate a PDF using the Asciidoctor and Docbkx Maven plugins.
- asciidoctor-diagram-example
-
Demonstrates how to integrate Asciidoctor Diagram with the Asciidoctor Maven plugin.
- asciidoctor-pdf-example
-
Demonstrates how to convert AsciiDoc to PDF using Asciidoctor PDF with the Asciidoctor Maven plugin.
- asciidoctor-epub-example
-
Demonstrates how to convert AsciiDoc to epub using Asciidoctor EPUB with the Asciidoctor Maven plugin. (contains also an example for .mobi (Kindle) output)
- asciidoc-maven-site-converter-example
-
Demonstrates how to process AsciiDoc in a Maven site using the Asciidoctor Converter Doxia Module.
- asciidoc-maven-site-parser-example
-
Demonstrates how to process AsciiDoc in a Maven site using the Asciidoctor Parser Doxia Module.
- asciidoc-multiple-inputs-example
-
An example project that demonstrates how to convert multiple input AsciiDoc documents to HTML5 and PDF using the Asciidoctor Maven plugin.
- java-extension-example
-
An example project that demonstrates how to create an extension for Asciidoctorj (written in Java) and how to use it in an other documentation Maven module.
- asciidoc-to-revealjs-example
-
Demonstrates how to convert AsciiDoc to reveal.js using Asciidoctor revealjs with the Asciidoctor Maven plugin.
The root pom.xml
(aggregate build) is provided to allow you to run all the example projects at once using a single invocation of Maven.
It also drives the continuous integration (CI) build.
The root pom.xml
does not contain any shared build configuration so that each of the projects can be used independently.
This makes the examples suitable as independent references and as a starting point for your own project.
Asciidoctor Maven plugin relies on asciidoctor project to do the actual rendering. This is a Ruby implementation integrated thanks to the JRuby project, which is a required dependency to run the plugin. The maven plugin provides a default version of the jruby-complete
artifact to ease its configuration. However, it can be overwritten just adding a custom version in the plugin’s dependency section as seen in the following example:
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
<version>${asciidoctor.maven.plugin.version}</version>
<dependencies>
<dependency>
<groupId>org.jruby</groupId>
<artifactId>jruby</artifactId>
<version>${jruby.version}</version>
</dependency>
<dependencies>
</plugin>
We want you! Yes, you.
Anyone can contribute to an Asciidoctor project. If you have a specialty, or just some creativity to share, we need your participation. We have big aspirations for the project and we need an assortment of skill sets in order to reach them. Make no mistake, contributing is not just for developers.
Of course, we’ll always need help with the code as it’s the basis of the project. But code isn’t going to make the project successful alone. We also need documentation, automation, design, marketing, communication, advocacy and more for it to make an impact.
Here are just a few of the ways you can contribute to the project:
-
Reporting bugs (The easiest way to get started!)
-
Sharing ideas on https://asciidoctor.zulipchat.com/ or https://discuss.asciidoctor.org
-
Suggesting new feature or improvements in the issue tracker
-
Speaking about the technology
-
Advocating for the technology
-
Assisting with design and/or UX (stylesheets, themes, logos, etc)
-
Conducting user studies and collecting feedback
-
Automating system administration tasks (releases, changelog, announcements, hosting, etc)
-
Writing, editing or maintaining the documentation
-
Organizing the content (information architecture & content strategy)
-
Using or extending the software in a creative way
-
Testing a prerelease, a pull request or master
-
Reviewing or providing feedback on pull requests
-
Writing code (No patch is too small!)
-
Fixing typos
-
Adding or revising comments or API docs
-
Fixing issues
-
Writing tests
-
Refactoring the code
-
-
Something we haven’t suggested…seriously!
The best way to get involved is just to show up and express your interest. We have a very friendly and encouraging culture. Harassment or offensive behavior is simply not tolerated. We are positive, even when being critical. We also strive to lift others up and help them be successful. We want your choice to participate in an Asciidoctor project be the start of an exciting and rewarding journey. So thanks for showing up!
Even when this project does not contain much code, we encourage the following good practices to improve accessibility and ease the use of the examples:
-
Document relevant details of an example in the appropriate README file
-
what makes this example useful
-
relevant components used (backends, extensions, …)
-
how to execute the example and see the results
-
possible use scenarios
-
-
Comment relevant Java methods and classes, especially when writing extensions
-
Follow simples code conventions to improve readability on the web
-
Use 4 white spaces instead of tabs
-
Avoid long lines in the Java code (they’re good in AsciiDoc files though)
-
-
Tests are named after each example name.
To help with style conventions editorconfig is provided. It only checks for tabs (which should be replaced by white spaces) and line breaks. Most populars IDE support it out-of-the-box or via plugins.
Copyright © 2014 The Asciidoctor Project. Free use of this software is granted under the terms of the MIT License.
See the LICENSE.adoc file for details.