Skip to content

Instantly share code, notes, and snippets.

@mgreau
Last active August 29, 2015 14:06
Show Gist options
  • Save mgreau/d5abc0a3246f1bd784a2 to your computer and use it in GitHub Desktop.
Save mgreau/d5abc0a3246f1bd784a2 to your computer and use it in GitHub Desktop.
JBoss Forge Asciidoctor addon

JBoss Forge Asciidoctor addon

Note

JBoss Forge needs to be installed.

More info on the JBoss Forge website.

Install the Asciidoctor addon

  • Run Forge

    forge
  • Install the jboss forge asciidoctor addon

    addon-install-from-git --url https://github.com/mgreau/asciidoctor-forge-addon.git --coordinate org.jboss.forge.addon.asciidoctor:asciidoctor-forge-addon,1.0.0-SNAPSHOT

Configure Asciidoctor for Maven projects

Html5 output

  • create a new forge project

    project-new --named myproject
  • setup asciidoctor for Html5 outpout

    asciidoctor-setup --useAsciidoctorDiagram -a toc=right sourceHighlighter=coderay icons=font sectanchors
  • build the project with forge

    build
  • open the generated file

    open target/generated-docs/manual.html

PDF outpout

  • create a new forge project

    project-new --named myproject
  • setup asciidoctor for PDF outpout

    asciidoctor-setup --converter pdf -a toc sectanchors idprefix=a_ idseparator=_
  • build the project with forge

    build
  • open the generated file

    open target/generated-docs/manual.pdf

Process AsciiDoc in a Maven site using Asciidoctor

  • create a new forge project

    project-new --named myproject
  • add the maven-site-plugin with the Asciidoctor Maven plugin configuration

    asciidoctor-generate-site
  • generate the maven site

    mvn site:site
  • open the generated file

    open target/site/hello.html

Process Asciidoc file with shell command

forge
track-changes
asciidoctor -a stylesheet! src/docs/asciidoc/sample.adoc

Then open the sample.adoc file and update the content, save it and wait a few time until the asciidoctor processor converts the sample.adoc to a sample.html output.

@mgreau
Copy link
Author

mgreau commented Oct 8, 2014

@mojavelinux @gastaldi @lincolnthree hi guys, a first version for the "asciidoctor shell" feature with resource monitor is available on github. So you can test it with the following commands :

forge
track-changes
asciidoctor -a stylesheet! src/docs/asciidoc/sample.adoc

Then open the sample.adoc file and make any update in the document, save it and wait a few second until the asciidoctor processor converts the sample.adoc to a sample.html output.

@mojavelinux
Copy link

I really like the asciidoc shell command, but something inside me really wants it to be asciidoctor. Perhaps you can simply allow either name?

@mgreau
Copy link
Author

mgreau commented Oct 12, 2014

Oups, it was an error in the documentation :)
Sure, I've created an asciidoctor shell command, Asciidoctor FTW !
Thank to your message, I now understand why my unit test has failed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment