using plantuml %load_json in DocToolchain

27 views Asked by At

i try to use the possibility to schon an external json file in a class dirgram, embedded in an asciidoc fil using doctoolchain.

i'm able to reference the file with include:

----
include::../../plantuml/test.json[]
----

But that is not working:

!$remote_json = %load_json("../../plantuml/test.json")

However, if i use the absolute path, it works:

!$remote_json = %load_json("/home/user/git/project/src/test/resources/SAMPLE_CREATE_1.json")

There is a config param plantuml.include.path, but i've no idea where to set this in doctoolchain.

Any idea ?

1

There are 1 answers

0
rdmueller On

I wasn't aware of the %loadJSON functionality, but if an absolute path works for you, then you should use the projectRootDir attribute in AsciiDoc.

When you use src/docs in docToolchain as base folder for your docs and this is located within /home/user/projects/myprojects, then projectRootDir points to /home/user/projects/myprojects. So, to include src/docs/test.json, you can use include::{projectRootDir}/src/docs/test.json[].

I hope this helps.