asciidoctor / asciidoctor-diagram

:left_right_arrow: Asciidoctor diagram extension, with support for AsciiToSVG, BlockDiag (BlockDiag, SeqDiag, ActDiag, NwDiag), Ditaa, Erd, GraphViz, Mermaid, Msc, PlantUML, Shaape, SvgBob, Syntrax, UMLet, Vega, Vega-Lite and WaveDrom.
http://asciidoctor.org
MIT License
432 stars 106 forks source link

How can we pass the plantuml preprocess variable to a referenced puml file? #397

Closed c6supper closed 1 year ago

c6supper commented 1 year ago

I want to include a another local file in referenced puml file, but how could I do that?

@startuml

skinparam wrapWidth 200
skinparam Backgroundcolor transparent
skinparam defaultTextAlignment center
skinparam fixCircleLabelOverlapping true

!include %get_variable_value("THEME_INCLUDE")/config.iuml

|external|
start
-> Power up;
|wfd_server|
:Load qcdisplay.xml;
:Configure DPU;
' #fabcb8:Forward Message to SoC >
|sdf|
:Process Telltale logic;
:Message to Signal;
end

legend left
    |Color| Type |
    |<#FF0000>| Type A class|
    |<#00FF00>| Type B class|
    |<#0000FF>| Type C class|
endlegend

@enduml
pepijnve commented 1 year ago

!include should work. I'm not sure what %get_variable_value("THEME_INCLUDE") will resolve to though. Perhaps that's causing issues?

c6supper commented 1 year ago

!include should work. I'm not sure what %get_variable_value("THEME_INCLUDE") will resolve to though. Perhaps that's causing issues?

I think that's the problem, actually I get problem trying to pass the macro(THEME_INCLUDE) to the puml. When build that puml individually , I could pass that macro as "-DTHEME_INCLUDE="$(shell pwd)/build/template" considering use the CLI app "plantuml.jar"

pepijnve commented 1 year ago

I don't think I ever added support for passing externally defined variables on to PlantUML, but I'll check.

pepijnve commented 1 year ago

I double checked the code and as I thought I never implemented first class support for defining PlantUML variables, skin parameters or pragma values. The easiest way to achieve this I think is by using a PlantUML config file containing the necessary !define statements and then pointing to that using the plantuml-config asciidoc document attribute.

c6supper commented 1 year ago

I double checked the code and as I thought I never implemented first class support for defining PlantUML variables, skin parameters or pragma values. The easiest way to achieve this I think is by using a PlantUML config file containing the necessary !define statements and then pointing to that using the plantuml-config asciidoc document attribute.

Hi pepijnve,

Thanks for your advice.