plantuml-stdlib / C4-PlantUML

C4-PlantUML combines the benefits of PlantUML and the C4 model for providing a simple way of describing and communicate software architectures
MIT License
6.33k stars 1.1k forks source link

Themes not working locally #306

Closed MaheshvaranP closed 1 year ago

MaheshvaranP commented 1 year ago

Hi

I might be missing something, please help me figure out what might be wrong about how I am using themes? Here is a view of the code and output.

Thanks!

image

kirchsth commented 1 year ago

@MaheshvaranP, yes I know. It is a problem of PlantUML itself (theme does not support "calculated includes" and includes via <C4/theme>; details see in forum) but until I have access to a first published plantuml version with v2.6.0 - that I can test it - I don't want to create a defect). As workaround you could use a normal include statement (theme is basically only a semantic/nicer format of an include)

following should work (I hope I have no typo but the logic should be clear)

!include %getenv("HOME")/repositories/C4-PlantUML/themes/puml-theme-C4_united.puml

Best regards Helmut

PS.: I used in my local test themes with a fix relative path, this works too

!if %variable_exists("RELATIVE_INCLUDE")
  ' !theme C4_FirstTest from %get_variable_value("RELATIVE_INCLUDE")/themes
  !theme $UseTheme from ./../themes
!else
  !theme $UseTheme from https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/themes
!endif
MaheshvaranP commented 1 year ago

!include %getenv("HOME")/repositories/C4-PlantUML/themes/puml-theme-C4_united.puml

Works perfect, thank you for the guidance! :)

kirchsth commented 1 year ago

opened in plantuml-forum an issue that "!theme via stdlib" !theme C4_united from <C4/theme> and "calculated !theme" !theme C4_united from $baseUrl/themes should be fixed.