PlantUML !include preprocessor?
See original GitHub issueI’m using lot of !include files in PlantUML diagrams to have clear sturcture and DRY.
== UML class diagram test with kroki
[plantuml, "diagram-classes", svg]
....
!include <src/style-presets.iuml>
class BlockProcessor
class DiagramBlock
class DitaaBlock
class PlantUmlBlock
BlockProcessor <|-- DiagramBlock
DiagramBlock <|-- DitaaBlock
DiagramBlock <|-- PlantUmlBlock
....
For local builds with plantuml.jar it works, but with remote server like PlantUML server or kroki it does not work. I understand that it is not wanted, because it will do preprocessing with knowlegde of PlantUML syntax and has to be updated etc.
Is there other solution to solve similar structural problems at client side?
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (10 by maintainers)
Top Results From Across the Web
Use the preprocessor - PlantUML
The PlantUML preprocessor provides features close to the C preprocessor. You can include files, define constant and macros. It's also possible to use ......
Read more >Advanced Use — Ashley's PlantUML Doc 0.2.01 documentation
Preprocessor ¶ · can .zip a file and include it · You can use system environment variable or constant definition when using include....
Read more >Plantuml - Foliant
PlantUML is a tool to generate diagrams from plain text. This preprocessor finds PlantUML diagrams definitions in the source and converts them into...
Read more >Is it possible to run only the preprocessor? - PlantUML Q&A
Hi,. Iis it possible to just run the preprocessor and get back a new plantuml file without any macros, !include or !define etc...
Read more >PlantUML: With preprocessor, how to check if key is present?
I think it's enough to check the value ( !if $domain_color.technical ): @startuml !$domain_color?={ "technical": "#gray" } '!$domain_color ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For using the Asciidoctor include derective i’ve to rework all the diagrams. It would be good to have a preprocessing task at client before sending it to the server. So at the end this would be good just to include the diagram files: e.g.
presentation.adoc
:The diagram file itself includes other needed files.
src/diagram-classes.puml
:So the preprocessor should fetch all the files recursevly and avoid loading same files (include loop).
P.S.: similar was implemented in the vscode-plantuml plugin.
Sort of, the PlantUML preprocessor resolves
!include
directives in order to create a “standalone” diagram definition.Unfortunately, it can’t resolve “complex” statements like
%get_variable_value
. Instead, the PlantUML preprocessor will try to read a file (using%get_variable_value("RELATIVE_INCLUDE")/C4.puml
as path) on your local file system.It’s tricky because it’s a preprocessor, so it cannot evaluate PlantUML syntax such as the if condition or the
%get_variable_value
function.Do you send your diagrams to the public instance https://kroki.io or to a local instance?
If you want to use the built-in version of C4, I would recommend to use the following syntax:
In this case, the preprocessor will ignore the
!include
directive and Kroki server will resolve the!include
directive using built-in C4 definition files.