Closed cachescrubber closed 5 months ago
I had a closer look and most likely the issue is in between the asciidoctor-diagram
/ asciidoctor-diagram-java
repos. Is it possible to transfer the issue? Just let me know, I'll close and re-open otherwise.
If the person has write (admin?) permissions in both projects, this is possible. As I don't have those permissions in the target project, please re-open an issue in the target repository.
I can take care of it.
Further analysis after reading asciidoctor-diagram
, asciidoctor-diagram-java
and structurizr-dsl
source:
The contents of a workspace dsl fragment embedded in an asciidoc is passed as a String:
org.asciidoctor.diagram.structurizr.Structurizr#parseWorkspace
is using com.structurizr.dsl.StructurizrDslParser#parse(java.lang.String)
.
structurizr-dsl is referencing include files relative to the filename of a workspace.dsl file, which does not exists in this case. There is code prepared in asciidoctor-diagram-java
to support an X-Structurizr-IncludeDir
but structurizr-dsl lacks a public method to pass in a include-directory. So a solution here would involve support from structurizr-dsl as well.
However in case of a Diagram Block Macro
, it is possible to pass the filename the macro points to directly to structurizr-dsl using com.structurizr.dsl.StructurizrDslParser#parse(java.io.File)
.
Hi @pepijnve , i have just noticed your activity on this issue (could it be that an issue transfer silences notifications?) Thanks a lot!
FYI I raised an issue in structurizr/java
to support a public parse method which allows a proper includeDirectory.
The next structurizr-java release will support a public void parse(String, File)
method: https://github.com/structurizr/java/commit/4f5aa81a5cfb743cd85312dbfc4221b975c0b86d
This should be fixed in 2.2.16
Many Thanks -- I could verify the include file processing using the example mentioned above.
Structurizr DSL include file is not working
Using the
!include
feature of the Structurizr DSL does not work as expected:Steps to reproduce
I prepared an example project demonstrating the issue.
https://github.com/cachescrubber/asciidoctor-diagram-structurizr-include
Open the file
src/main/asciidoc/system-catalog/dsl/preview.adoc
.Using the strucurizr-cli is working as expected:
Environment
Plugin Version: 0.41.4
IntelliJ Details: IntelliJ IDEA 2023.3.1 (Ultimate Edition) Build #IU-233.11799.300, built on December 12, 2023 Runtime version: 17.0.9+7-b1087.7 aarch64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. macOS 14.2 org.asciidoctor.intellij.asciidoc (0.41.4)