Open ggrossetie opened 4 years ago
data-uri doesn't work with Antora under any circumstances. The fix for this was in https://gitlab.com/antora/antora/-/issues/536, but I have no idea if that would still apply. If Dan indicates he'll apply it I'd consider checking.
data-uri doesn't work with Antora under any circumstances.
The idea here is to:
So basically, it will be equivalent to:
image::data:image/png;base64,...[]
I believe that the above is working, because in this case Asciidoctor won't do any processing on the target, so it will be converted to:
<image src="data:image/png;base64,..."></image>
It would be wonderful if I'm wrong!
Perhaps why I couldn't get it to work is because I was asking asciidoctor to encode the data uri, which still seems like the most appropriate option to me, since it can... why duplicate functionality?
I don't think that producing something that isn't inline from inline instructions is a good idea. Dan could take a minute and fix the problem in Antora.
There are so many options... is there a specific instruction for a-kroki to produce a data-uri?
It would be wonderful if I'm wrong!
I can confirm that using a data-uri
as a target in an image
block macro is working:
image::data:image/png;base64,...[]
(you can try using the data-uri returned by: http://www.plantuml.com/plantuml/base64/SoWkIImgAStDuKhCoKnELT2rKqZAJ-82OX0JBCRba9gN0bG10000)
Perhaps why I couldn't get it to work is because I was asking asciidoctor to encode the data uri, which still seems like the most appropriate option to me, since it can... why duplicate functionality?
Yes, Asciidoctor.js 1.5.8 cannot fetch and encode the data-uri properly.
which still seems like the most appropriate option to me, since it can... why duplicate functionality?
I don't mind if Asciidoctor encodes a content to a data-uri but as mentioned previously Asciidoctor should not fetch the content (when the content is already fetched).
I don't think that producing something that isn't inline from inline instructions is a good idea.
Yes that's a workaround so this is not ideal :|
The other alternative is to ignore the kroki-fetch-diagram
option but it has drawbacks too.
Dan could take a minute and fix the problem in Antora.
I think it should be fixed upstream: https://github.com/asciidoctor/asciidoctor/issues/3698
There are so many options... is there a specific instruction for a-kroki to produce a data-uri?
No we do not provide an option to generate a data-uri but in my opinion this part should be managed by the converter/processor depending on a generic option. In summary, the extension should create an Image node with the contents of the image (bytes) and then Asciidoctor should inline the content according to the format of the image.
Root cause in Antora now discussed in https://gitlab.com/antora/antora/-/issues/1001
I think we should workaround this limitation otherwise an exception is thrown:
The least worst solution is to pass the diagram as data-uri. It's not 100% accurate but it should work. Maybe we should add a warning message to let the user know?