asciidoctor / asciidoctor-kroki

Asciidoctor.js extension to convert diagrams to images using Kroki!

Home Page:https://kroki.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Converter cannot locate fetched diagram if image output directory does not match imagesdir

mojavelinux opened this issue · comments

If the image output directory does not match the value of imagesdir, such as when imagesoutdir is specified, the converter cannot locate the fetched diagram. This particularly affects Asciidoctor PDF, which must read the image in order to embed it.

The current workaround for this situation in Asciidoctor Diagram is to use an absolute path as the image target if the data-uri attribute is set on the document. See:

Since setting the data-uri has other implications, we may decide to settle on a different attribute name.

Since we plan to add support for the imagesdir on the image node in core (see asciidoctor/asciidoctor#3660), one approach is to rely on that enhancement and set the imagesdir attribute on the generated node if it differs from the normal location. That way, the converter doesn't have to do any extra work.

@mojavelinux should we anticipate this change and set the imagesdir attribute on the generated node today?

Since we plan to add support for the imagesdir on the image node in core (see asciidoctor/asciidoctor#3660), one approach is to rely on that enhancement and set the imagesdir attribute on the generated node if it differs from the normal location. That way, the converter doesn't have to do any extra work.

So, if imagesoutdir is specified we should set the imagesdir attribute on the generated node? Maybe we should always set the imagesdir on the generated node?

Yes, I'm confident that we can add the check for imagesdir on the node in 2.1. I'll revive asciidoctor/asciidoctor#3661

Maybe we should always set the imagesdir on the generated node?

Can't hurt, esp since this is essentially an internal negotiation with the converter.