Login  Register

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

Posted by mojavelinux on Oct 05, 2013; 1:35am
URL: https://discuss.asciidoctor.org/Contribution-Integrating-asciidoctor-fopdf-with-asciidoctor-gradle-plugin-tp689p714.html

Rob,

This is a great idea! I think that integrating the asciidoctor-fopdf into the build plugins might be the best place to start, then gradually see how far up the chain we should push it (such as into the Asciidoctor Java integration). Iteration is certainly the key strategy here.

What I would like to do as part of this integration (perhaps before) is to move the asciidoctor-fopdf project into the Asciidoctor organization. I didn't put it there right away because I wasn't sure how the experiment would work. Since it turned out to work pretty well, I think the time has come to graduate it. That's a pretty easy change.

As part of the graduation, I'd also like the change the name from "fopdf" to "fopub". The reason is, the same setup can be used to produce any output supported by the bundled DocBook XSL stylesheets, including ePub and chunked HTML. Although I still plan to fold those output formats into Asciidoctor core, some teams may still prefer to use the DocBook toolchain.

I'll wait a few days to collect some feedback before I move the repository, in case there is a strong preference for a different name.

When you integrate with Gradle, I recommend using "fopdf" as the backend name instead of "pdf". We want to reserve the name "pdf" to leave room for when Asciidoctor has built-in PDF export.

I'm thrilled that you're interested in bringing fopdf / fopub to the Gradle plugin. This will close several important gaps in the Asciidoctor ecosystem.

Cheers,

-Dan


On Thu, Oct 3, 2013 at 4:40 PM, rwinch [via Asciidoctor :: Discussion] <[hidden email]> wrote:
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


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Contribution-Integrating-asciidoctor-fopdf-with-asciidoctor-gradle-plugin-tp689.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | http://google.com/profiles/dan.j.allen