ggrossetie / asciidoctor-web-pdf

Convert AsciiDoc documents to PDF using web technologies
https://asciidoctor.org
MIT License
443 stars 91 forks source link

Generate HTML in wrong folder #584

Closed isylhdin closed 2 years ago

isylhdin commented 2 years ago

I'm trying to generate a pdf from my .adoc file with the following commands :

asciidoctor-pdf doc/index.adoc -o dist/doc.pdf
asciidoctor-pdf -D dist doc/index.adoc

It produces a doc.pdf file in the distfolder But it also produces a doc.html file in the docfolder too.

Am I missing something or is it a bug ? Thx

ggrossetie commented 2 years ago

The HTML file is a temporary file or more precisely an intermediate file in order to produce a PDF. The destination folder should contain the PDF file. Currently, the HTML file is always generated in the "current" directory.

The problem is that the HTML file might use relative paths, so if we don't generate the HTML file in the "current" directory the browser won't properly resolve these paths. I have yet to find a solution 😓

Related issue: https://github.com/Mogztter/asciidoctor-web-pdf/issues/130

isylhdin commented 2 years ago

Ok, I've added to my script :

asciidoctor-pdf doc/index.adoc -o dist/doc.pdf && del-cli doc/doc.html

in order to delete this temporary file

ggrossetie commented 2 years ago

Closing as this is a duplicate of #130