Issues rendering diagrams in folder structure

0 votes
asked Jan 19, 2023 in Question / help by Andrei
Hello everyone,

We have a folder structure in a git repo something like this :

- some_folder_with_stuff
- hello_world.puml
- diagrams_folder
   - diagram1.puml
   - diagram2.puml

   - dependency_folder
          - depenency_uml.puml

If i go to the terminal and run java -jar plantuml.jar ./hello_world.puml from the root folder all good. So everything is installed correctly.

When i convert the diagrams from the diagrams_folder (diagram1 and diagram2), by running java -jar plantuml.jar ./diagrams_folder/diagram1.puml  they !include diragram_folder/dependency_folder/dependency_uml.puml and i get an error regarding the include path. Using VisualStudio Code, this works fine so there should be a fix.

My guess is that every run takes the working as the the one where the .puml file is. Is there any way i can pin it to a specific one?

I see that i can use a config file but what should i put in that config file to fix that working directory to be the same?

The command line arguments don't support this, right? Or at least my blind eyes can't seem to find anything that would indicate that...

Please help :)
commented Jan 19, 2023 by The-Lu (64,760 points)

Hello A.,

Perhaps use absolute path and not relative path.

Perhaps, for input file (that is a supposition!), there are the same mechanism as output dir, see `command line` doc.:

You can specify an output directory for all images using the -o switch:

java -jar plantuml.jar -o "c:/outputPng" "c:/directory2"

If you recurse into several directory, there is a slight difference if you provide an absolute or a relative path for this output directory:

  • An absolute path will ensure that all images are output to a single, specific, directory.

  • If you provide a relative path then the images is placed in that directory relative to the location of the input file, not the current directory (note: this applies even if the path begins with a .). When Plantuml processes files from multiple directories then the corresponding directory structure is created under the computed output directory.

To test...

If that can help,
Regards.

commented Jan 20, 2023 by Andrei
Thank you for your time but unfortunately that -o switch is not of much help as the problem is more the input rather than the output.

When PlantUML is trying to convert the diagrams it does understand the include paths as (my guess is that) the include path is calculated relative to the file path and not the PWD (current running directory in the terminal).

1 Answer

0 votes
answered Mar 5 by Dima

How specify an output directory for all images in docker container?

...