asciidoctor / jekyll-asciidoc

:syringe: A Jekyll plugin that converts AsciiDoc source files in your site to HTML pages using Asciidoctor.
https://github.com/asciidoctor/jekyll-asciidoc
MIT License
311 stars 78 forks source link

generating pdf outputs #171

Open JGrenier opened 6 years ago

JGrenier commented 6 years ago

Hi,

Can we use asciidoctor-pdf and asciidoctor-epub to generate respectively html, pdf and epub directly with jekyll ?

I suceeded to get revealjs working but i got an error with pdf.

This is what i've done for now based on the revealjs details found in #136 :

in the adoc source i added the attributes :

:backend: pdf
:page-layout: false

in the _config.yml

plugins:
  - jekyll-feed
  - jekyll-asciidoc
  - asciidoctor-mathematical
  - asciidoctor-revealjs
  - asciidoctor-pdf

The error returned is :

  Liquid Exception: undefined method `to_liquid' for #<Asciidoctor::Pdf::Converter:0x00007f83200d91c0> in feed.xml
             Error: undefined method `to_liquid' for #<Asciidoctor::Pdf::Converter:0x00007f83200d91c0>
             Error: Run jekyll build --trace for more information.

Seems that the converter is called but is it a layout matter ?

What am I missing, thanks in advance for your help, any thoughts are welcome.

mojavelinux commented 6 years ago

This plugin really wasn't designed to produce anything other than HTML. There are several places in the plugin where it assumes it's dealing with a string. However, both PDF and EPUB3 return object data. So those assumptions would have to be changed.

If someone wants to work on this, I'd be happy to assist. I don't have the bandwidth to take it on myself.

djencks commented 3 years ago

Another approach for pdfs would be to emulate asciidoctor-web-pdf and use perhaps https://github.com/YusukeIwaki/puppeteer-ruby to get Chromium to render the pdfs.