Closed ggrossetie closed 3 years ago
I vote for this issue!
I experiencing difficulties with multi-file & multi-directory documentation project. We are using plantuml include directives with relative paths to parent plantuml document. asciidoctor-kroki preprocessor builds include file paths relative to main asciidoctor documents.
As the consequences we have:
The plantuml preprocessor here use definition like supported in PlantUML via parameter plantuml.include.path and implicitly set it to doc.getBaseDir()
. This behaviour works for us, because we have used property -Dplantuml.include.path=${docBaseDir}
for preprocessing and then always use this as base path for all includes, e.g. !include ./diagrams/style.iuml
.
I think this can be changed to have the implicit behaviour like -Dplantuml.include.path=${diagramDir}
and resolve from the first included diagram. But we need additionally also the support of parameter plantuml.include.path=
similiar to PlantUML core for other valid use cases.
Let's take an example:
docs/index.adoc
docs/diagrams/hello.puml
docs/diagrams/style.puml
Currently, the extension won't resolve
style.puml
because the path is resolved from the base directory.In the above example the resolved path will be
docs/style.puml
instead ofdocs/diagrams/style.puml
.Implementation-wise, the last parameter should be the diagram directory and not the base directory:
https://github.com/Mogztter/asciidoctor-kroki/blob/1372acb3bad3cad143fcbab5a7c8aaa5f802cfb7/src/asciidoctor-kroki.js#L76
This issue is a follow-up of: #191 (where we did this change for Vega diagrams)