asciidoctor / asciidoctor-gradle-plugin

A Gradle plugin that uses Asciidoctor via JRuby to process AsciiDoc source files within the project.
https://asciidoctor.github.io/asciidoctor-gradle-plugin/
Apache License 2.0
283 stars 120 forks source link

Add Asciidoctor Diagram support #148

Closed dobermai closed 9 years ago

dobermai commented 9 years ago

It would be awesome if the gradle plugin would have the ability to allow the use of asciidoctor-diagram. The concrete use case for me is to include PlantUML Diagrams in the document.

Since Groovy Extensions are available, would this be possible with a Groovy Extension Wrapper?

abelsromero commented 9 years ago

~~Good news are that asciidoctor-diagram can be integrated with no problems in your gradle build :sparkles: Just include the gem in the requires method of the asciidoctor task~~

asciidoctor {
    ...
    requires 'asciidoctor-diagram'
}

Bad news, is that some diagrams require the installation of Graphviz separately. asciidoctor-diagram requires acces to the command tool dot. Currently, you need to install Graphviz and set the command in the Path as any other command tool.

aalmiray commented 9 years ago

You actually need a bit more than just a requires statement if the gem is not already on your system. In the future you'll be able to apply just one more jar to your build script given https://github.com/asciidoctor/asciidoctorj/commit/c8d8f348a52b4315a953edab2e429959308c5879

This PR creates asciidoctorj-diagram.x.y.z.jar much like asciidoctorj-pdf is created. Be warned that only Ditaa is supported from the get go. You'll need additional software installed on your system, for example, GraphViz and Shaape (via python).

abelsromero commented 9 years ago

Sorry for the confusion, @aalmiray is right, I completely forgot that right now (untill the PR is released with a new version) you need to download the gem, e.g. using jruby-gradle-plugin.

Now, I hope I can at least make amends with an full example, see this article if you need to set a project right now http://mrhaki.blogspot.com.es/2014/11/awesome-asciidoctor-use-asciidoctor.html

dobermai commented 9 years ago

Awesome, thanks @aalmiray and @abelsromero, this is exactly what I needed. Thanks a lot!

aalmiray commented 9 years ago

We can close this one as it's related to asciidoctorj.

mojavelinux commented 9 years ago

Exactly. As much as possible we want the Gradle plugin to simply rely on AsciidoctorJ to handle core concerns like this. That way, we keep the plugin lean and AsciidoctorJ more powerful.