Open schferbe opened 4 years ago
Looks like this is always going to the remote server (www.plantuml.com): https://github.com/adrianvlupu/C4-Builder/blob/master/utils.js#L119
I'm working on a feature to allow it to clone the C4-PlantUML repo locally. Hopefully it will be up this weekend.
@schferbe, the generateLocalImages
refers to the actual image generation from .puml
files without hitting the PlantUML server. Most likely you don't have java, graphviz and all the stuff required to actually do it locally. I think I need to update the readme with how to set that up or try to make the module actually install them.
@azizur, the line is from a helper function in case the online server is used. The relevant lines are in https://github.com/adrianvlupu/C4-Builder/blob/master/build.js#L584, https://github.com/adrianvlupu/C4-Builder/blob/master/build.js#L158 and https://github.com/adrianvlupu/C4-Builder/blob/master/build.js#L102
I wouldn't necessarily go with relative include paths. If you work on the same project with a couple of colleagues, or on a couple different devices, this forces every environment to stick to a certain folder structure.
From my point of view (and maybe it's already possible and I simply missed it), it should be good enough to provide a way to configure PlantUML's include path.
This is another problem with C4-PlantUML local install.
I use it locally by replacing the C4-Plantuml web paths to local paths.
Repro:
c4builder site -w
The problem with this is that when another developer downloads the docs the absolute path must be replaced everywhere.
Summary:
!include ..\docs\C4-PlantUML-master\C4_Component.puml
works but the site generation c4builder site -w
brakes
!include C:\absolute_path\docs\C4-PlantUML-master\C4_Component.puml
works fine in both VS and site -w but makes it much harder for a team to work on the project until they all keep the same folder structure, a.k.a. same absolute paths.
Possible solution: Is it hard to add a path in the config that changes that?
Hi, any update on this issue?
Do you accept PRs? I can try to work on this.
Yes, I accept PRs. Last weekend I managed to merge a couple of them. I would really appreciate a PR.
There's a branch I use for local development at https://github.com/adrianvlupu/C4-PlantUML/tree/local, that could be a good starting point.
I solved this for now while the final solution is being developed using a local plantuml server in a docker container and adding the capability to serve as a static file the core C4 files, and modify C4 files to get the dependencies from this local server. Here is my initial approach: https://github.com/darielrll/c4-builder-example
This (work on local solution) sounds promising.
My current workaround is as such:
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Container.puml
is replaced with
!include %getenv("C4PLANTUML")/C4_Container.puml
.C4PLANTUML
environment variable. I work on Mac, and that prep script sets the environment for both the current terminal session, and it uses launchctl
to set it globally, so that further processes that are started also are aware of the variable.c4builder
.I noticed that if I have a file .vscode/settings.json
with the following:
{
"plantuml.includepaths": ["C4-PlantUML directory"]
}
it works in VS Code.
The solution you work on... Could it scan that .vscode/settings.json
if it exists, and use that?
- Put "C4-PlantUML" in the project root.
- Update "!include https://raw.githubusercontent.com/adrianvlupu/C4-PlantUML/latest/C4_Component.puml" to "!include <C4/C4_Component>"
thanks , and my additional settings: in vscode settings: "plantuml.includepaths": ["/path/to/C4-PlantUML-2.4.0"], "plantuml.commandArgs": ["-DRELATIVE_INCLUDE=\".\""]
The C4-PlantUML documentation suggests that you can include the
puml
files locally with relative paths. I tried this withc4builder site
and"generateLocalImages": true
but that results in errors.Is there a way that I missed?