Login  Register

Contribution: Integrating asciidoctor-fopdf with asciidoctor-gradle-plugin

Posted by rwinch on Oct 03, 2013; 10:40pm
URL: https://discuss.asciidoctor.org/Contribution-Integrating-asciidoctor-fopdf-with-asciidoctor-gradle-plugin-tp689.html

I'd like to contribute integrating asciidoctor-fopdf with the asciidoctor-gradle-plugin. I've already got a modified working
version of the asciidoctor-gradle-plugin that allows users to produce both html5 and pdf by adding something like this
to their Gradle build:

asciidoctor {
    backends = ["html5", "pdf"]
    options = [
        attributes: [
              ....
        ]
    ]
}

The code I have can certainly use a few iterations to make it cleaner, but I believe the first steps to provide proper
integration involve creating a shared jar. Specifically, it would be good to provide the following in a jar that is available
in a (maven) repository of some sort:

* org.asciidoctor.gradle.InputHandler

* The contents of asciidoctor-fopdf/src/dist in an archive within the Jar. By placing it within an archive within the jar,
the Gradle plugin can copy the archive and then decompress the entirety of the jar so that the resources can be reused.

By placing these shared resources within a jar would ensure that the Gradle integration gets updates to these resources
rather than having to copy them manually (which is what I am currently doing).

Once this is done, I can integrate my code along with the Gradle plugin. I'd be glad to assist (or do all the work) with
migrating these common utilities to a shared jar as well, but wanted to run this by the community first.

Any thoughts / feedback to this approach is welcome :)

Cheers,
Rob Winch