Customizing PDF export template

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Customizing PDF export template

unfa
Hi!

I have some documents written is Asciidoc (using Atom with Asciidoc add-ons).

I'd like to customize the PDF export template a bit.

Specifically: I need to get rid of the first title page, and add the document title (and subtitle) in a table on the top of the first page instead.

I haven't found any information on the Internet so far, so I decided to ask directly here, as I search further.
I've never dug into Asciidoctor export templates before so I feel a bit lost as it seems a vast topic.

I'd appreciate if someone can give me a hint where to go.

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

Re: Customizing PDF export template

unfa
Ok, so I'va managed to find the templates used:
$ locate asciidoctor | grep .yml
/var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.16/data/themes/base-theme.yml
/var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.16/data/themes/default-theme.yml

I've copied them as a reference and managed to use them for asciidoctor-pdf export from Atom's preview.

Now I just need to find out what do I have to change in that .yml.

I want to:

1. Get rid of the title page
2. Add the title and subtitle on top of first page instead

Making the table is less important, though knowing how to do that would be great later.
Reply | Threaded
Open this post in threaded view
|

Re: Customizing PDF export template

abelsromero
Hi, welcome to the  forum!

Not sure eveything you want to do can be achieved, but I think you should have a look at the theme guide:
https://github.com/asciidoctor/asciidoctor-pdf/blob/master/docs/theming-guide.adoc.

Amongst other things, it shows how to disable the title page with an attrtibute:
The title page can be disabled from the document by setting the notitle attribute in the AsciiDoc document header.
If you want ot play with it, in the maven plugin examples we have a demo ready to use (provided you have Java and maven): https://github.com/asciidoctor/asciidoctor-maven-examples/blob/master/asciidoctor-pdf-with-theme-example/.

If you want to ran directly from Ruby, you can see the required attributed to add to the command in the pom.xml.