Importing PlantUML
Written against PlantUML 1.2025 and C4-PlantUML 2. meltemi-diagrams import and the VS Code commands report every
construct that is not mapped exactly: approximated constructs keep their meaning with a
different drawing; dropped ones are left out. An import that drops an essential construct
(an element, a relation, a message, an entity or a line it cannot read) is partial.
Preprocessor
Section titled “Preprocessor”| Source | Meltemi | Status | Notes |
|---|---|---|---|
!define NAME value, !define NAME(a, b) body, ## |
expanded | mapped | |
!definelong NAME(a) … !enddefinelong, !undef |
expanded | mapped | |
!$x = v, !$x ?= v, !global, !local, $x in lines |
substituted | mapped | |
!procedure, !unquoted procedure, defaults, keyword arguments |
expanded | mapped | |
!function … !return … !endfunction, one-line !function $f($a) !return … |
evaluated | mapped | |
!if, !elseif, !else, !endif, !ifdef, !ifndef |
the selected lines | mapped | |
!while … !endwhile, !foreach $x in [ … ] … !endfor |
the repeated lines | mapped | At most 1000 passes. |
%strlen, %substr, %strpos, %upper, %lower, %string, %intval, %boolval, %true, %false, %not, %newline, %chr, %ord, %mod, %dec2hex, %hex2dec, %variable_exists, %function_exists, %get_variable_value, %set_variable_value, %call_user_func, %size, %splitstr, %str2json, %json_key_exists |
evaluated | mapped | |
%date, %now, %random, %getenv, %filename, %dirpath, %version, colour functions |
stable values | approximated | Imports are deterministic: dates and environment are empty. |
!assert, !log, !dump_memory |
checked or ignored | mapped | |
!include path, !include_once, !include_many, !includesub path!ID, !include path!n |
the file’s lines | mapped | Relative to the including file, inside the imported folder or project. |
!include <C4/C4_Container> and the C4-PlantUML files by URL |
the C4 level | mapped | Recognised, never read. |
!include <aws/…> and other standard libraries |
— | dropped | Their macros are not imported. |
!includeurl, !include https://…, absolute paths, paths outside the folder, missing files, !import |
— | dropped | import.include, essential: the importer never fetches files. |
| errors, more than 100 nested expansions or 100 000 lines | — | dropped | import.preprocessor, essential. |
!theme |
— | dropped | |
!pragma |
— | dropped |
Common
Section titled “Common”| Source | Meltemi | Status | Notes |
|---|---|---|---|
title text, title … end title |
title |
mapped | |
' text, /' … '/ |
// text |
mapped | |
@startuml name … @enduml |
one diagram per block; name is its id |
mapped | An unclosed block is import.syntax. |
skinparam |
— | dropped | |
<style> … </style> |
— | dropped | |
legend |
— | dropped | |
header |
— | dropped | |
footer |
— | dropped | |
caption |
— | dropped | |
hide, show, remove, restore |
— | dropped | |
scale |
— | dropped | |
newpage |
— | dropped | |
allowmixing |
— | dropped | |
allow_mixing |
— | dropped | |
mainframe |
— | dropped | |
set |
— | dropped | |
page |
— | dropped | |
sprite |
— | dropped | |
| class diagrams | — | dropped | import.unsupported-diagram. |
| activity diagrams | — | dropped | import.unsupported-diagram. |
| state diagrams | — | dropped | import.unsupported-diagram. |
| object diagrams | — | dropped | import.unsupported-diagram. |
| timing diagrams | — | dropped | import.unsupported-diagram. |
| data diagrams | — | dropped | import.unsupported-diagram. |
@startgantt |
— | dropped | import.unsupported-diagram. |
@startmindmap |
— | dropped | import.unsupported-diagram. |
@startwbs |
— | dropped | import.unsupported-diagram. |
@startjson |
— | dropped | import.unsupported-diagram. |
@startyaml |
— | dropped | import.unsupported-diagram. |
@startsalt |
— | dropped | import.unsupported-diagram. |
@startditaa |
— | dropped | import.unsupported-diagram. |
@startdot |
— | dropped | import.unsupported-diagram. |
@startmath |
— | dropped | import.unsupported-diagram. |
@startlatex |
— | dropped | import.unsupported-diagram. |
@startchen |
— | dropped | import.unsupported-diagram. |
@startchronology |
— | dropped | import.unsupported-diagram. |
@startfiles |
— | dropped | import.unsupported-diagram. |
@startregex |
— | dropped | import.unsupported-diagram. |
@startebnf |
— | dropped | import.unsupported-diagram. |
@startboard |
— | dropped | import.unsupported-diagram. |
@startcreole |
— | dropped | import.unsupported-diagram. |
@startdef |
— | dropped | import.unsupported-diagram. |
@startflow |
— | dropped | import.unsupported-diagram. |
@startgit |
— | dropped | import.unsupported-diagram. |
@startnwdiag |
— | dropped | import.unsupported-diagram. |
@startproject |
— | dropped | import.unsupported-diagram. |
@startwire |
— | dropped | import.unsupported-diagram. |
C4_Deployment |
— | dropped | import.unsupported-diagram. |
C4_Sequence |
— | dropped | import.unsupported-diagram. |
| an empty block | — | dropped | import.unsupported-diagram. |
Component, deployment and use case
Section titled “Component, deployment and use case”| Source | Meltemi | Status | Notes |
|---|---|---|---|
component |
node |
mapped | |
node |
node |
mapped | |
rectangle |
node |
mapped | |
card |
node with shape document |
mapped | |
agent |
node |
mapped | |
artifact |
node |
mapped | |
file |
node with shape document |
mapped | |
folder |
node with shape document |
mapped | |
frame |
node |
mapped | |
package |
node |
mapped | |
cloud |
node with shape cloud |
mapped | |
hexagon |
node with shape hexagon |
mapped | |
stack |
node |
mapped | |
label |
node |
mapped | |
action |
node |
mapped | |
process |
node |
mapped | |
boundary |
node |
mapped | |
control |
node |
mapped | |
entity |
node |
mapped | |
collections |
node |
mapped | |
database |
data |
mapped | |
storage |
data |
mapped | |
queue |
data |
mapped | |
interface |
node with shape circle |
mapped | |
circle |
node with shape circle |
mapped | |
actor |
node with shape person |
mapped | |
person |
node with shape person |
mapped | |
usecase |
node with shape ellipse |
mapped | |
[Component], (), (Use case), :Actor: |
as their keywords | mapped | |
component name { … } |
group |
approximated | |
node name { … } |
group |
mapped | |
rectangle name { … } |
group |
mapped | |
card name { … } |
group |
mapped | |
agent name { … } |
group |
approximated | |
artifact name { … } |
group |
approximated | |
file name { … } |
group |
approximated | |
folder name { … } |
group |
mapped | |
frame name { … } |
group |
mapped | |
package name { … } |
group |
mapped | |
cloud name { … } |
group |
mapped | |
hexagon name { … } |
group |
approximated | |
stack name { … } |
group |
approximated | |
label name { … } |
group |
approximated | |
action name { … } |
group |
approximated | |
process name { … } |
group |
approximated | |
boundary name { … } |
group |
approximated | |
control name { … } |
group |
approximated | |
entity name { … } |
group |
approximated | |
collections name { … } |
group |
approximated | |
database name { … } |
group |
approximated | |
storage name { … } |
group |
approximated | |
queue name { … } |
group |
approximated | |
interface name { … } |
group |
approximated | |
circle name { … } |
group |
approximated | |
actor name { … } |
group |
approximated | |
person name { … } |
group |
approximated | |
usecase name { … } |
group |
approximated | |
"Label" as a, a as "Label", [Label] as a |
id and label | mapped | |
<<stereotype>> |
description «stereotype» |
approximated | |
#colour, #line:c, #line.dashed, #text:c |
fill, stroke, line dashed, color |
mapped | |
-->, ->, ..>, --, <--, -[#red]->, -[bold]->, -[thickness=n]-> |
relations; dotted is -->; no head is the line -- (--- when dotted); colours and widths become styles |
mapped | |
--|>, <|--, *--, o--, --x, }|--||, }o--o| |
triangleOutline, diamond, diamondOutline, cross and the crow’s-foot heads at their end |
mapped | |
--#, --+, --^, -(0- |
plain arrowheads | approximated | |
<-->, <..>, *--* |
<->, <-->, with the head at both ends |
mapped | |
-left->, -up->, -l-> and other direction hints |
a relation | approximated | Directions are left to the layout. |
a "1" --> "*" b |
a relation without end labels | approximated | |
-[hidden]-> |
— | dropped | |
note left|right|top|bottom of x : text, note … end note, note "text" as N |
note joined to its element by the dashed line --- |
mapped | |
note on link |
— | dropped | |
left to right direction, top to bottom direction |
direction LR, direction TB |
mapped | |
together { … } |
— | dropped | Its elements are kept. |
port, portin, portout |
— | dropped | |
unbalanced { } |
— | dropped | import.syntax. |
| a declaration without a name | — | dropped | import.syntax. |
| unreadable lines | — | dropped | import.syntax, essential; kept as a comment. |
Sequence
Section titled “Sequence”| Source | Meltemi | Status | Notes |
|---|---|---|---|
participant "Label" as a |
participant |
mapped | |
actor "Label" as a |
actor |
mapped | |
boundary "Label" as a |
boundary |
mapped | |
control "Label" as a |
control |
mapped | |
entity "Label" as a |
entity |
mapped | |
database "Label" as a |
database |
mapped | |
collections "Label" as a |
collections |
mapped | |
queue "Label" as a |
queue |
mapped | |
| participant colours | — | dropped | |
| participant stereotypes | — | dropped | |
box "title" … end box |
group |
mapped | |
| box colours | — | dropped | |
a -> b : text |
a -> b: "text" |
mapped | |
a --> b |
a --> b |
mapped | |
a ->> b, a -->> b |
{ kind async } |
mapped | |
->x, ->o, -\, -// and other heads |
plain messages | approximated | |
<->, <--> |
<->, <-->; two different heads are approximated as one way |
mapped | |
-[#red]> |
— | dropped | |
[-> a, a ->], ?-> a |
messages through a participant outside |
approximated | |
& a -> b |
sequential messages | approximated | |
a -> b ++, a -> b -- |
activate b, deactivate a |
mapped | |
create b, ** |
create b |
mapped | |
destroy b, !! |
destroy b |
mapped | |
activate b |
activate b |
mapped | |
deactivate b |
deactivate b |
mapped | |
return text |
a reply to the caller and deactivate |
mapped | |
autonumber [start] |
autonumber |
mapped | |
autonumber start step "format" |
autonumber start |
approximated | |
autonumber stop|resume|inc |
— | dropped | |
alt text |
alt alt1 "text" { … } |
mapped | |
else text |
} else "text" { (and in par) |
mapped | |
opt text |
opt opt1 "text" { … } |
mapped | |
loop text |
loop loop1 "text" { … } |
mapped | |
par text |
par par1 "text" { … } |
mapped | |
break text |
break break1 "text" { … } |
mapped | |
critical text |
critical critical1 "text" { … } |
mapped | |
group text |
region region1 "text" { … } |
mapped | |
note left|right|over a[, b] : text, note … end note |
note |
mapped | |
hnote, rnote |
note |
approximated | |
note across |
a note over every participant | approximated | |
note left: text after a message |
a note beside its participant | approximated | |
ref over a, b : text |
note over a, b "ref: text" |
approximated | |
== text == |
divider "text" |
mapped | |
..., ...text... |
delay |
mapped | |
|||, ||45|| |
— | dropped | |
hide footbox |
— | dropped | |
end without a fragment |
— | dropped | import.syntax. |
| unreadable lines | — | dropped | import.syntax, essential; kept as a comment. |
C4-PlantUML
Section titled “C4-PlantUML”| Source | Meltemi | Status | Notes |
|---|---|---|---|
left to right direction |
direction LR |
mapped | |
Person(alias, label, …) |
person |
mapped | |
Person_Ext(alias, label, …) |
person with external |
mapped | |
System(alias, label, …) |
system |
mapped | |
System_Ext(alias, label, …) |
system with external |
mapped | |
SystemDb(alias, label, …) |
system |
approximated | A database system is drawn as a system. |
SystemDb_Ext(alias, label, …) |
system with external |
approximated | A database system is drawn as a system. |
SystemQueue(alias, label, …) |
system |
approximated | A queue system is drawn as a system. |
SystemQueue_Ext(alias, label, …) |
system with external |
approximated | A queue system is drawn as a system. |
Container(alias, label, …) |
container |
mapped | |
ContainerDb(alias, label, …) |
datastore |
mapped | |
ContainerQueue(alias, label, …) |
container |
approximated | A queue container is drawn as a container. |
Container_Ext(alias, label, …) |
container |
approximated | Only persons and systems are marked external. |
ContainerDb_Ext(alias, label, …) |
datastore |
approximated | Only persons and systems are marked external. |
ContainerQueue_Ext(alias, label, …) |
container |
approximated | A queue container is drawn as a container; only persons and systems are marked external. |
Component(alias, label, …) |
component |
mapped | |
ComponentDb(alias, label, …) |
component |
approximated | A database component is drawn as a component. |
ComponentQueue(alias, label, …) |
component |
approximated | A queue component is drawn as a component. |
Component_Ext(alias, label, …) |
component |
approximated | Only persons and systems are marked external. |
ComponentDb_Ext(alias, label, …) |
component |
approximated | A database component is drawn as a component; only persons and systems are marked external. |
ComponentQueue_Ext(alias, label, …) |
component |
approximated | A queue component is drawn as a component; only persons and systems are marked external. |
Boundary(alias, label) { … } |
flattened: its elements are kept | approximated | With $type="system" or "container" it is read as that boundary. |
Enterprise_Boundary(alias, label) { … } |
flattened: its elements are kept | approximated | |
System_Boundary(alias, label) { … } |
the system holding its containers; the view’s scope |
mapped | |
Container_Boundary(alias, label) { … } |
the container holding its components; the view’s scope |
mapped | Around containers without components it is read as their system’s boundary (approximated). |
Rel(from, to, label, techn) |
a model relation with technology |
mapped | |
Rel_Back(…), Rel_Back_Neighbor(…) |
the reversed relation | mapped | |
Rel_U, Rel_D, Rel_L, Rel_R, Rel_Up… Rel_Neighbor |
a relation | approximated | Directions are left to the layout. |
BiRel(…) and its directions |
two relations | approximated | |
RelIndex(n, from, to, …) |
a relation | approximated | Step numbers are not drawn. |
$descr of a relation |
— | dropped | |
$tags |
— | dropped | |
$sprite |
— | dropped | |
$link |
— | dropped | |
LAYOUT_LEFT_RIGHT() |
direction LR |
mapped | |
LAYOUT_LANDSCAPE() |
direction LR |
mapped | |
LAYOUT_TOP_DOWN() |
direction TB |
mapped | |
| a level without its scope | the next level up | approximated | |
| dynamic diagrams | a container view | approximated | Step numbers are not drawn. |
| persons or systems inside a boundary | top-level entities | approximated | |
| components outside a container boundary | a container that holds them | approximated | |
| containers outside a system boundary | the scope’s system, or one named after the diagram | approximated | |
Container(…) |
container |
mapped | Outside a system boundary it goes into the scope’s system or one named after the diagram (approximated). |
Deployment_Node, Node, Node_L, Node_R |
— | dropped | Essential: deployment diagrams are not imported. |
Node(…) |
— | dropped | Essential. |
| other macros | — | dropped | Essential. |
| unreadable lines | — | dropped | import.syntax, essential. |
unbalanced { } |
— | dropped | import.syntax. |
| an alias declared twice | — | dropped | import.syntax; the first declaration is kept. |
AddElementTag(…) |
— | dropped | Drawing only. |
AddRelTag(…) |
— | dropped | Drawing only. |
AddBoundaryTag(…) |
— | dropped | Drawing only. |
AddPersonTag(…) |
— | dropped | Drawing only. |
AddSystemTag(…) |
— | dropped | Drawing only. |
AddContainerTag(…) |
— | dropped | Drawing only. |
AddComponentTag(…) |
— | dropped | Drawing only. |
AddExternalPersonTag(…) |
— | dropped | Drawing only. |
AddExternalSystemTag(…) |
— | dropped | Drawing only. |
AddExternalContainerTag(…) |
— | dropped | Drawing only. |
AddExternalComponentTag(…) |
— | dropped | Drawing only. |
UpdateElementStyle(…) |
— | dropped | Drawing only. |
UpdateRelStyle(…) |
— | dropped | Drawing only. |
UpdateBoundaryStyle(…) |
— | dropped | Drawing only. |
UpdateContainerBoundaryStyle(…) |
— | dropped | Drawing only. |
UpdateSystemBoundaryStyle(…) |
— | dropped | Drawing only. |
UpdateEnterpriseBoundaryStyle(…) |
— | dropped | Drawing only. |
UpdateLayoutConfig(…) |
— | dropped | Drawing only. |
UpdateLegendTitle(…) |
— | dropped | Drawing only. |
UpdateSkinparamsAndLegendEntry(…) |
— | dropped | Drawing only. |
SHOW_LEGEND(…) |
— | dropped | Drawing only. |
SHOW_FLOATING_LEGEND(…) |
— | dropped | Drawing only. |
LAYOUT_WITH_LEGEND(…) |
— | dropped | Drawing only. |
LAYOUT_AS_SKETCH(…) |
— | dropped | Drawing only. |
HIDE_STEREOTYPE(…) |
— | dropped | Drawing only. |
HIDE_PERSON_SPRITE(…) |
— | dropped | Drawing only. |
SHOW_PERSON_SPRITE(…) |
— | dropped | Drawing only. |
SHOW_PERSON_PORTRAIT(…) |
— | dropped | Drawing only. |
SHOW_PERSON_OUTLINE(…) |
— | dropped | Drawing only. |
SHOW_ELEMENT_DESCRIPTIONS(…) |
— | dropped | Drawing only. |
SHOW_INDEX(…) |
— | dropped | Drawing only. |
HIDE_LEGEND(…) |
— | dropped | Drawing only. |
SetDefaultLegendEntries(…) |
— | dropped | Drawing only. |
Lay_U(…) |
— | dropped | Drawing only. |
Lay_Up(…) |
— | dropped | Drawing only. |
Lay_D(…) |
— | dropped | Drawing only. |
Lay_Down(…) |
— | dropped | Drawing only. |
Lay_L(…) |
— | dropped | Drawing only. |
Lay_Left(…) |
— | dropped | Drawing only. |
Lay_R(…) |
— | dropped | Drawing only. |
Lay_Right(…) |
— | dropped | Drawing only. |
Lay_Distance(…) |
— | dropped | Drawing only. |
increment(…) |
— | dropped | Drawing only. |
setIndex(…) |
— | dropped | Drawing only. |