Skip to content

Conversation

@kirchsth
Copy link
Member

fix of #240

the original idea of RELATIVE_INCLUDE (relative path between the different C4_* files and not between the concrete diagram and the called C4_* ) works for the build pipeline check but not for other scenarios.

Therefore a new RELATIVE_INCLUDE pattern is implemented:

  • RELATIVE_INCLUDE defines the relative path between the diagram file and the C4_* stdlib files. The path can be absolute too
  • if RELATIVE_INCLUDE is defined all C4_* files includes the other C4_* from the same folder

e.g. if following folder structure is given

and the diagram file TestFloatingLegend.puml (it is a copy of the percy folder) start with following

@startuml
' convert it with additional command line argument -DRELATIVE_INCLUDE="./.." to use locally
!if %variable_exists("RELATIVE_INCLUDE")
  !include %get_variable_value("RELATIVE_INCLUDE")/C4_Container.puml
!else
  !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml
!endif
...

then it can be converted with following 3 command (load relative, absolute, via url) started in /temp folder:

java -jar plantuml.jar -DRELATIVE_INCLUDE="./../../C4-PlantUML" /mnt/project/diagrams/TestFloatingLegend.puml
java -jar plantuml.jar -DRELATIVE_INCLUDE="/mnt/C4-PlantUML" /mnt/project/diagrams/TestFloatingLegend.puml
java -jar plantuml.jar /mnt/project/diagrams/TestFloatingLegend.puml

(it works with Windows too, but the issue was found on a Linux system)

It can be tested with my extended branch

BR Helmut

@kirchsth kirchsth requested a review from Potherca October 23, 2022 20:10
@kirchsth kirchsth linked an issue Oct 23, 2022 that may be closed by this pull request
@Potherca Potherca added this to the v2.5.0 milestone Oct 25, 2022
@kirchsth kirchsth merged commit 2fd6c7a into plantuml-stdlib:master Oct 26, 2022
@kirchsth kirchsth deleted the feature/240_fix_RELATIVE_INCLUDE branch October 26, 2022 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants