Roave / DocbookTool

:books: Docbook Tool for static documentation generation from Markdown files
52 stars 4 forks source link

Support embedding local images in generated PDFs #248

Closed Ocramius closed 2 years ago

Ocramius commented 2 years ago

While working with the tool today, I noticed that Markdown containing local imports will not work:

![An Image](./file.png)

This is because we are missing two things:

  1. --enable-local-file-access to allow file:// usage in WkHtmlToPdf
  2. the relative files need to be dragged in the build workspace: currently, we copy just the HTML file to be rendered: https://github.com/Roave/DocbookTool/blob/00942cc5d55f80734d4e4cbb46023fcc09cdb1e7/src/Writer/MultiplePdfFilesWriter.php#L50-L52

This requires some redesign of the tool, so that the HTML files are in the same location as the sources (during builds), rather than in a temporary/separate location