Open siaccarino opened 2 years ago
If you want to extend the built-in DocumentConverter
, you should install asciidoctor-pdf
locally.
Then, you can then register your custom converter:
Once that's done, you can require your file:
asciidoctor-web-pdf -r ./custom-converter.js -b custom-web-pdf doc.adoc
I think you can also replace the built-in converter if you register your custom converter as web-pdf
. If you do that, you can omit -b custom-web-pdf
.
The current template solution does not allow to override parts of the template - it is always a complete override but parts of the asciidoc environment are not available in the template - it is for example hard to realize a TOC with the current template solution.
I solved this temporary by a template which overrides asciidoc-web-pdf code:
But this solution is a bit hacky - it might be better to pass more data into the template or to allow partial overrides of convert_document.