asciidoctor / asciidoctor-maven-plugin

A Maven plugin that uses Asciidoctor via JRuby to process AsciiDoc source files within the project.
http://asciidoctor.org
Apache License 2.0
317 stars 122 forks source link

Allow to generate directly PDF #51

Closed rmannibucau closed 9 years ago

rmannibucau commented 11 years ago

Generating pdf is possible through docboock then another plugin usage, would be great to make it trivial simplifying the chaining (probably) or using an existing pdf library

Note: this was first discussed in the issue #27

mojavelinux commented 10 years ago

I would recommend pushing out 0.1.4 first, then adding this one. The reason is that we still are sorting out how to best integrate the fopub distribution and we don't want to hold up the release of 0.1.4 to finish that design. We can put it either in 0.1.4.1 or 1.5.0.

mojavelinux commented 10 years ago

See #64.

LightGuard commented 10 years ago

How do we want to do this? Are we going to use asciidoctor-pdf?

rmannibucau commented 10 years ago

+1, it will make ruby-java aligned which is important IMHO

lordofthejars commented 10 years ago

I think Dan is working on ascidoctor-pdf to meet converter API and embed inside asciidoctorj. But not yet done

Enviat des del meu iPhone

El 20/08/2014, a les 18.30, Jason Porter notifications@github.com va escriure:

How do we want to do this? Are we going to use asciidoctor-pdf?

— Reply to this email directly or view it on GitHub.

LightGuard commented 10 years ago

Do we need to wait for this before we can release? Technically there is a workaround today for this: generated docbook, then have jdocbook or pressgang pickup and use the generated docbook.

lordofthejars commented 10 years ago

Yes I will release and then in two weeks when we release the 1.5.1 we can add this gem

Enviat des del meu iPhone

El 20/08/2014, a les 19.10, Jason Porter notifications@github.com va escriure:

Do we need to wait for this before we can release? Technically there is a workaround today for this: generated docbook, then have jdocbook or pressgang pickup and use the generated docbook.

— Reply to this email directly or view it on GitHub.

mojavelinux commented 10 years ago

This is not a blocker for the plugin release. When asciidoctor-pdf is released, we have a mechanism for loading it even before AsciidoctorJ does it transparently.

lordofthejars commented 10 years ago

But intheory I should add gem indefensió asciidoctorj like we did in ePub right?

Enviat des del meu iPhone

El 20/08/2014, a les 20.46, Dan Allen notifications@github.com va escriure:

This is not a blocker for the plugin release. When asciidoctor-pdf is released, we have a mechanism for loading it even before AsciidoctorJ does it transparently. — Reply to this email directly or view it on GitHub.

mojavelinux commented 10 years ago

Yes, I believe so.

odrotbohm commented 10 years ago

Did I get it right that theoretically this should be doable with the 1.5.0 release and the correct setup of extensions? If so, is there some sample configuration anywhere?

LightGuard commented 10 years ago

The PDF renderer wasn't ready for 1.5.0. We'll have it out for 1.5.1. 

Currently you'll have to generate the DocBook then let jDocBook or PressGang plugins do the DocBook to PDF conversion, sorry.  — Sent from Mailbox

On Mon, Aug 25, 2014 at 9:14 AM, Oliver Gierke notifications@github.com wrote:

Did I get it right that theoretically this should be doable with the 1.5.0 release and the correct setup of extensions? If so, is there some sample configuration anywhere?

Reply to this email directly or view it on GitHub: https://github.com/asciidoctor/asciidoctor-maven-plugin/issues/51#issuecomment-53277090

mojavelinux commented 10 years ago

In theory it is possible to load it when with 1.5.0, but not until I convert the converter to the converter API. It should go quick as soon as I get to, hopefully within a week or so.

I'll make an example that shows how to setup the docbkx or jdocbook pipeline shortly in the example project so that at least we can point to that as an alternative.

leif81 commented 10 years ago

I'll make an example that shows how to setup the docbkx or jdocbook pipeline

:+1:

I'm curious myself!

odrotbohm commented 10 years ago

That's great news, thanks! Is there a rough ETA for 1.5.1?

LightGuard commented 10 years ago

Two weeks - four weeks is my guess. This is the big issue for 1.5.1— Sent from Mailbox

On Tue, Aug 26, 2014 at 5:07 AM, Oliver Gierke notifications@github.com wrote:

That's great news, thanks! Is there a rough ETA for 1.5.1?

Reply to this email directly or view it on GitHub: https://github.com/asciidoctor/asciidoctor-maven-plugin/issues/51#issuecomment-53404785

mojavelinux commented 10 years ago

Asciidoctor PDF is now rewritten as an Asciidoctor converter and the initial alpha has been released.

What we plan to do in AsciidoctorJ is create a submodule each for the EPUB3 converter and the PDF converter. These will become asciidoctorj-epub3 and asciidoctorj-pdf respectively. That means there will be nothing that needs to be added to the plugin to use them. You'll just have to add the jar file and set the backend to "epub3" or "pdf" (currently, epub3 works, but we're going to split it out of the main AsciidoctorJ jar).

In theory, you can now use it today with the Maven plugin. You currently have to configure the gem plugin to download and install the asciidoctor-pdf gem, then set gemPath to that location and add a requires entry for asciidoctor-pdf. However, obviously this will be much simpler once we have the asciidoctorj-pdf jar to use :)

lordofthejars commented 10 years ago

I will try (but not sure) to have it this weekend. I am saying not sure because I would like to go deeper in Nashorn first now that I have a fresh idea about it.

2014-09-05 11:53 GMT+02:00 Dan Allen notifications@github.com:

Asciidoctor PDF is now rewritten as an Asciidoctor converter and the initial alpha has been released.

What we plan to do in AsciidoctorJ is create a submodule each for the EPUB3 converter and the PDF converter. These will become asciidoctorj-epub3 and asciidoctorj-pdf respectively. That means there will be nothing that needs to be added to the plugin to use them. You'll just have to add the jar file and set the backend to "epub3" or "pdf" (currently, epub3 works, but we're going to split it out of the main AsciidoctorJ jar).

In theory, you can now use it today with the Maven plugin. You currently have to configure the gem plugin to download and install the asciidoctor-pdf gem, then set gemPath to that location and add a requires entry for asciidoctor-pdf. However, obviously this will be much simpler once we have the asciidoctorj-pdf jar to use :)

— Reply to this email directly or view it on GitHub https://github.com/asciidoctor/asciidoctor-maven-plugin/issues/51#issuecomment-54605673 .

+----------------------------------------------------------+ Alex Soto Bueno - Computer Engineer www.lordofthejars.com +----------------------------------------------------------+

odrotbohm commented 10 years ago

That's great news, Alex and Dan! Looking forward to play with this.

lordofthejars commented 10 years ago

Dan I think we can integrate this changes of adding pdf/epub modules with what is discussed here http://discuss.asciidoctor.org/AsciidoctorJ-1-X-Y-and-beyond-with-AsciidoctorJs-tp2090p2094.html

WDYT?

2014-09-05 17:30 GMT+02:00 Oliver Gierke notifications@github.com:

That's great news, Alex and Dan! Looking forward to play with this.

— Reply to this email directly or view it on GitHub https://github.com/asciidoctor/asciidoctor-maven-plugin/issues/51#issuecomment-54640419 .

+----------------------------------------------------------+ Alex Soto Bueno - Computer Engineer www.lordofthejars.com +----------------------------------------------------------+

mojavelinux commented 10 years ago

Dan I think we can integrate this changes of adding pdf/epub modules with what is discussed here http://discuss.asciidoctor.org/AsciidoctorJ-1-X-Y-and-beyond-with-AsciidoctorJs-tp2090p2094.html

I totally agree. The epub3 and pdf backends both bring in MB of gems, so it's good to have them as separate modules. Both can depend on asciidoctorj (or asciidoctor-jruby) so that only a single dependency is required.

mojavelinux commented 10 years ago

There's now an example up of using Asciidoctor PDF in a Maven build to generate a PDF. Note that the current approach uses the gem-maven-plugin to download the asciidoctor-pdf gem directly. This step will be unnecessary once the asciidoctorj-pdf jar is available.

https://github.com/asciidoctor/asciidoctor-maven-examples/tree/master/asciidoc-to-pdf-example

mojavelinux commented 10 years ago

With these examples available, I think we can close this issue. There is nothing we need to change in the plugin to make this possible, so we'll chase down the issues in the other parts.

rmannibucau commented 10 years ago

Hmm, can't we add gem support in the plugin, this seems a pretty complex config for pretty much nothing

lordofthejars commented 10 years ago

For now it may seems, but in next version it would not be required. This is only a workaround. Keep in mind that epub3 is already integrated. But pdf was released after the release of asciidoctor, so until next version you can do it in this way.

2014-09-10 13:02 GMT+02:00 Romain Manni-Bucau notifications@github.com:

Hmm, can't we add gem support in the plugin, this seems a pretty complex config for pretty much nothing

— Reply to this email directly or view it on GitHub https://github.com/asciidoctor/asciidoctor-maven-plugin/issues/51#issuecomment-55100351 .

+----------------------------------------------------------+ Alex Soto Bueno - Computer Engineer www.lordofthejars.com +----------------------------------------------------------+

rmannibucau commented 10 years ago

so asciidoc-to-pdf-example should reflect it I think since that is on master

lordofthejars commented 10 years ago

Not seen this example yet, can you send me the link? but for example in Asciidoctor it may work as a single gem, the "problem" is with Maven that you may need to install gem by yourself

2014-09-10 13:24 GMT+02:00 Romain Manni-Bucau notifications@github.com:

so asciidoc-to-pdf-example reflect it I think since that is on master

— Reply to this email directly or view it on GitHub https://github.com/asciidoctor/asciidoctor-maven-plugin/issues/51#issuecomment-55101995 .

+----------------------------------------------------------+ Alex Soto Bueno - Computer Engineer www.lordofthejars.com +----------------------------------------------------------+

rmannibucau commented 10 years ago

That's Dan's one https://github.com/asciidoctor/asciidoctor-maven-examples/tree/master/asciidoc-to-pdf-example

That's the issue: if it needs to be done with maven then the issue is not done for me. It was already possible to get pdf with 100 lines of maven plugins ;)

lordofthejars commented 10 years ago

yes this is the way to be done. Nothing more for now. In next release you will need to do nothing special, but for now the workaround proposed by Dan is the correct one.

2014-09-10 13:48 GMT+02:00 Romain Manni-Bucau notifications@github.com:

That's Dan's one https://github.com/asciidoctor/asciidoctor-maven-examples/tree/master/asciidoc-to-pdf-example

That's the issue: if it needs to be done with maven then the issue is not done for me. It was already possible to get pdf with 100 lines of maven plugins ;)

— Reply to this email directly or view it on GitHub https://github.com/asciidoctor/asciidoctor-maven-plugin/issues/51#issuecomment-55104049 .

+----------------------------------------------------------+ Alex Soto Bueno - Computer Engineer www.lordofthejars.com +----------------------------------------------------------+

mojavelinux commented 9 years ago

That's the issue: if it needs to be done with maven then the issue is not done for me. It was already possible to get pdf with 100 lines of maven plugins ;)

Agree 100%. That's the goal, to make this just another backend in the main plugin config.

mojavelinux commented 9 years ago

It should now be possible to add the asciidoctorj-pdf dependency and set the backend to PDF. The Maven example will be updated shortly.

odrotbohm commented 9 years ago

Awesome, thanks! :)

mojavelinux commented 9 years ago

Here's an example of the Gradle plugin in action:

https://github.com/rwinch/asciidoctor-gradle-plugin-backends-sample/blob/master/build.gradle

Paul van der Maden is going to be updating the Maven examples project to demonstrate the usage of AsciidoctorJ PDF. I'll follow-up to make sure it gets updated.