owenh000 / asciidoctor-multipage

A configurable multipage HTML converter for Asciidoctor
https://owenh.net/asciidoctor-multipage
MIT License
58 stars 23 forks source link

--template-dir disables multipage generation #19

Open cirosantilli opened 2 years ago

cirosantilli commented 2 years ago

Gemfile

source 'https://rubygems.org'

gem 'asciidoctor', '2.0.11'
gem 'asciidoctor-multipage', '0.0.12 '

tmp.adoc

= h1

== h2

Builds fine with the standard:

bundle exec asciidoctor -b multipage_html5 -D out/tmp -r asciidoctor-multipage tmp.adoc

Outcome: out/tmp/tmp.html and out/tmp/_h2.html are generated as expected.

But if I add --template-dir template_dir on the command line to create custom output elements (see https://stackoverflow.com/questions/63917971/how-to-create-custom-html-output-for-an-existing-asciidoctor-asciidoc-macro/63917972#63917972 ):

mkdir template_dir
bundle exec asciidoctor -b multipage_html5 -D out/tmp --template-dir template_dir -r asciidoctor-multipage tmp.adoc

then only out/tmp/tmp.html is generated, but not out/tmp/_h2.html.

It does not make a difference it template_dir contain anything or not.

owenh000 commented 2 years ago

@cirosantilli, thanks for the report. Internally, Asciidoctor ties in a separate TemplateConverter for handling the provided templates; this breaks the asciidoctor-multipage extension. More investigation is needed.

marcj commented 1 year ago

Since --template-dir isn't working, what is the correct way to change the generated HTML?

owenh000 commented 1 year ago

Hi @marcj! If --template-dir is the recommended way to change the generated HTML for Asciidoctor, then it is also the recommended way for asciidoctor-multipage. If you need this issue fixed, please consider contributing by opening a pull request for the necessary changes or sponsoring the project. Thanks!

owenh000 commented 3 months ago

This issue may require #46 to be done first, because resolving that issue will hopefully provide more control over Asciidoctor generation of the individual output pages.