Closed danieleades closed 1 year ago
Hi! I've checked the book you mentioned, and it looks like there's some issue with your code:
The image src path is wrong, so actually the generated web page can't even show the picture, not to mention the pdf one.
After I changed that line into let depth = ctx.path.ancestors().count() - 2;
, the embedded images will display normally when built as a PDF.
So this is not something related to mdbook-pdf, and I'm sure images will be OK as long as they display normally in web pages.
now this is where it gets weird. I've been developing using mdbook serve
rather than mdbook build
. If i use serve
then the image displays correctly in the html... Not clear to me why that would be the case.
Regardless- the fix you proposed works perfectly. thank you
now this is where it gets weird. I've been developing using
mdbook serve
rather thanmdbook build
. If i useserve
then the image displays correctly in the html... Not clear to me why that would be the case.Regardless- the fix you proposed works perfectly. thank you
Finally I understand why you didn't find this bug, as basically ..
works just like .
without any error shown when you are already in the root path.
If you use mdbook serve
, as it will serve as a local server in a root path, ../d2/1.1.png
will be equivalent to ./d2/1.1.png
. While it's not the case when you open print.html
directly.
i have a document with embedded images. The embedded images are not visible when built as a PDF. Should i expect this to work?
Images are in PNG format
reproduction: https://github.com/danieleades/mdbook-d2/tree/file-extension/example