owenh000/asciidoctor-multipage

--template-dir disables multipage generation

cirosantilli opened this issue · 4 comments

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.

@************, 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

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

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!

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.