Open ggrossetie opened 4 years ago
I am not familiar with the context and how this is solved by Antora. But I can describe how I solved this for Antora style images for the Antora support of the plugin. This might not be elegant, but works for now.
The class AntoraReferenceAdapter takes an Antora style reference, resolves it and replaces it with the regular reference.
Then html5-antora.rb uses prepend
to monkey-patch the HTML5 output. There is a similar file for the PDF output, provided resolved images for classic asciidoctor-pdf.
Do you want to try something similar for Kroki?
I am not familiar with the context and how this is solved by Antora. But I can describe how I solved this for Antora style images for the Antora support of the plugin. This might not be elegant, but works for now. The class AntoraReferenceAdapter takes an Antora style reference, resolves it and replaces it with the regular reference.
Thanks for the explanation, I will take a look.
Do you want to try something similar for Kroki?
I was thinking about extracting the logic of resolving an Antora style reference to a "workspace" reference (from AntoraReferenceAdapter) and then somehow pass it to the Kroki extension. I think it makes more sense to keep the logic in the Intellij plugin rather than duplicating it in the Kroki extension. But that's something we will need to explore because I don't know if what I'm describing can actually work. Anyway, it's good to know that we have an alternative if this is not possible.
Looking at the code I have written there, I have to admit it didn't get all the love it deserved in terms of documentation and tests. If you know more about the API you need, I'll be happy to lend a hand in extracting/refactoring it as needed.
Hi,
Running into the same problem as reported by @ggrossetie .
I read the comments and did see a mention on an alternative. Is there an alternative available or is still issue still pending the refactoring of the AntoraReferenceAdapter?
unable to render AsciiDoc document
org.asciidoctor.jruby.internal.AsciidoctorCoreException:
org.jruby.exceptions.SystemCallError: (ENOENT) No such file or directory
- PROJECT_DIR/docs/modules/ROOT/pages/:partial$chart.vlite
The Asciidoctor Kroki (JavaScript) extension can resolve Antora's resource identifier using the content catalog object:
For instance, you can use the
partial$
prefix in the target of theplantuml
macro:It's working because when the extension is registered, Antora passes a "context" that contains the content catalog:
In the Intellij plugin, we cannot use the Antora's content catalog but we could pass a "context" that contains a similar method to resolve resources?
I'm not entirely sure about AsciidoctorJ/JRuby can call this "register" method... What do you think?
Currently, the above AsciiDoc document produces an error: