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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

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

rwinch
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
Reply | Threaded
Open this post in threaded view
|

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

mojavelinux
Administrator
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



--
Reply | Threaded
Open this post in threaded view
|

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

rwinch
Dan,

I really like your suggestions about the naming. If there is anything I can do to assist with this initial phase, please let me know. Once the resources are available in a jar from a repository I will start to work on integrating my changes with the Gradle plugin.

Cheers,
Rob

PS: I am also excited to be able to give something back to asciidoctor community :) As time permits I have some other ideas for the Gradle plugin. One of the more exciting ideas is to support live editing (i.e. guard start) from the Gradle plugin. This will make it easier for Java devs to do live editing of asciidocs. I'd also like to do some cleanup, add tests, etc.
Reply | Threaded
Open this post in threaded view
|

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

mojavelinux
Administrator

On Oct 4, 2013 8:15 PM, "rwinch [via Asciidoctor :: Discussion]" <[hidden email]> wrote:

> I really like your suggestions about the naming. If there is anything I can do to assist with this initial phase, please let me know. Once the resources are available in a jar from a repository I will start to work on integrating my changes with the Gradle plugin.

Great! I'll make that shift in the coming days and be in touch.

>
> PS: I am also excited to be able to give something back to asciidoctor community :) As time permits I have some other ideas for the Gradle plugin. One of the more exciting ideas is to support live editing (i.e. guard start) from the Gradle plugin. This will make it easier for Java devs to do live editing of asciidocs. I'd also like to do some cleanup, add tests, etc.

Excellent! I predict that feature will be immediately popular. I can't tell you how many times I've been asked about it.

-Dan

Reply | Threaded
Open this post in threaded view
|

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

glaforge
PDF, live-editing... the dream combo :-)


On Tue, Oct 8, 2013 at 2:50 AM, mojavelinux [via Asciidoctor :: Discussion] <[hidden email]> wrote:

On Oct 4, 2013 8:15 PM, "rwinch [via Asciidoctor :: Discussion]" <[hidden email]> wrote:

> I really like your suggestions about the naming. If there is anything I can do to assist with this initial phase, please let me know. Once the resources are available in a jar from a repository I will start to work on integrating my changes with the Gradle plugin.

Great! I'll make that shift in the coming days and be in touch.

>
> PS: I am also excited to be able to give something back to asciidoctor community :) As time permits I have some other ideas for the Gradle plugin. One of the more exciting ideas is to support live editing (i.e. guard start) from the Gradle plugin. This will make it easier for Java devs to do live editing of asciidocs. I'd also like to do some cleanup, add tests, etc.

Excellent! I predict that feature will be immediately popular. I can't tell you how many times I've been asked about it.

-Dan




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-tp689p753.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Guillaume Laforge
Groovy Project Manager
Pivotal, Inc.