Skip to content

Commit 0d49553

Browse files
authoredMar 21, 2022
Added support for PlantUML (#3372)
1 parent 554ff32 commit 0d49553

20 files changed

+1011
-3
lines changed
 

‎components.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎components.json

+5
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,11 @@
10271027
"modify": "php",
10281028
"owner": "milesj"
10291029
},
1030+
"plant-uml": {
1031+
"title": "PlantUML",
1032+
"alias": "plantuml",
1033+
"owner": "RunDevelopment"
1034+
},
10301035
"plsql": {
10311036
"title": "PL/SQL",
10321037
"require": "sql",

‎components/prism-plant-uml.js

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
(function (Prism) {
2+
var variable = /\$\w+|%[a-z]+%/;
3+
4+
var arrowAttr = /\[[^[\]]*\]/.source;
5+
var arrowDirection = /(?:[drlu]|do|down|le|left|ri|right|up)/.source;
6+
var arrowBody = '(?:-+' + arrowDirection + '-+|\\.+' + arrowDirection + '\\.+|-+(?:' + arrowAttr + '-*)?|' + arrowAttr + '-+|\\.+(?:' + arrowAttr + '\\.*)?|' + arrowAttr + '\\.+)';
7+
var arrowLeft = /(?:<{1,2}|\/{1,2}|\\{1,2}|<\||[#*^+}xo])/.source;
8+
var arrowRight = /(?:>{1,2}|\/{1,2}|\\{1,2}|\|>|[#*^+{xo])/.source;
9+
var arrowPrefix = /[[?]?[ox]?/.source;
10+
var arrowSuffix = /[ox]?[\]?]?/.source;
11+
var arrow =
12+
arrowPrefix +
13+
'(?:' +
14+
arrowBody + arrowRight +
15+
'|' +
16+
arrowLeft + arrowBody + '(?:' + arrowRight + ')?' +
17+
')' +
18+
arrowSuffix;
19+
20+
Prism.languages['plant-uml'] = {
21+
'comment': {
22+
pattern: /(^[ \t]*)(?:'.*|\/'[\s\S]*?'\/)/m,
23+
lookbehind: true,
24+
greedy: true
25+
},
26+
'preprocessor': {
27+
pattern: /(^[ \t]*)!.*/m,
28+
lookbehind: true,
29+
greedy: true,
30+
alias: 'property',
31+
inside: {
32+
'variable': variable
33+
}
34+
},
35+
'delimiter': {
36+
pattern: /(^[ \t]*)@(?:end|start)uml\b/m,
37+
lookbehind: true,
38+
greedy: true,
39+
alias: 'punctuation'
40+
},
41+
42+
'arrow': {
43+
pattern: RegExp(/(^|[^-.<>?|\\[\]ox])/.source + arrow + /(?![-.<>?|\\\]ox])/.source),
44+
lookbehind: true,
45+
greedy: true,
46+
alias: 'operator',
47+
inside: {
48+
'expression': {
49+
pattern: /(\[)[^[\]]+(?=\])/,
50+
lookbehind: true,
51+
inside: null // see below
52+
},
53+
'punctuation': /\[(?=$|\])|^\]/
54+
}
55+
},
56+
57+
'string': {
58+
pattern: /"[^"]*"/,
59+
greedy: true
60+
},
61+
'text': {
62+
pattern: /(\[[ \t]*[\r\n]+(?![\r\n]))[^\]]*(?=\])/,
63+
lookbehind: true,
64+
greedy: true,
65+
alias: 'string'
66+
},
67+
68+
'keyword': [
69+
{
70+
pattern: /^([ \t]*)(?:abstract\s+class|end\s+(?:box|fork|group|merge|note|ref|split|title)|(?:fork|split)(?:\s+again)?|activate|actor|agent|alt|annotation|artifact|autoactivate|autonumber|backward|binary|boundary|box|break|caption|card|case|circle|class|clock|cloud|collections|component|concise|control|create|critical|database|deactivate|destroy|detach|diamond|else|elseif|end|end[hr]note|endif|endswitch|endwhile|entity|enum|file|folder|footer|frame|group|[hr]?note|header|hexagon|hide|if|interface|label|legend|loop|map|namespace|network|newpage|node|nwdiag|object|opt|package|page|par|participant|person|queue|rectangle|ref|remove|repeat|restore|return|robust|scale|set|show|skinparam|stack|start|state|stop|storage|switch|title|together|usecase|usecase\/|while)(?=\s|$)/m,
71+
lookbehind: true,
72+
greedy: true
73+
},
74+
/\b(?:elseif|equals|not|while)(?=\s*\()/,
75+
/\b(?:as|is|then)\b/
76+
],
77+
78+
'divider': {
79+
pattern: /^==.+==$/m,
80+
greedy: true,
81+
alias: 'important'
82+
},
83+
84+
'time': {
85+
pattern: /@(?:\d+(?:[:/]\d+){2}|[+-]?\d+|:[a-z]\w*(?:[+-]\d+)?)\b/i,
86+
greedy: true,
87+
alias: 'number'
88+
},
89+
90+
'color': {
91+
pattern: /#(?:[a-z_]+|[a-fA-F0-9]+)\b/,
92+
alias: 'symbol'
93+
},
94+
'variable': variable,
95+
96+
'punctuation': /[:,;()[\]{}]|\.{3}/
97+
};
98+
99+
Prism.languages['plant-uml'].arrow.inside.expression.inside = Prism.languages['plant-uml'];
100+
101+
Prism.languages['plantuml'] = Prism.languages['plant-uml'];
102+
103+
}(Prism));

‎components/prism-plant-uml.min.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎examples/prism-plant-uml.html

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<h2>Full example</h2>
2+
<pre><code>' Source: https://plantuml.com/sequence-diagram
3+
@startuml
4+
participant Participant as Foo
5+
actor Actor as Foo1
6+
boundary Boundary as Foo2
7+
control Control as Foo3
8+
entity Entity as Foo4
9+
database Database as Foo5
10+
collections Collections as Foo6
11+
queue Queue as Foo7
12+
Foo -> Foo1 : To actor
13+
Foo -> Foo2 : To boundary
14+
Foo -> Foo3 : To control
15+
Foo -> Foo4 : To entity
16+
Foo -> Foo5 : To database
17+
Foo -> Foo6 : To collections
18+
Foo -> Foo7 : To queue
19+
@enduml
20+
</code></pre>

‎plugins/autoloader/prism-autoloader.js

+1
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@
227227
"objectpascal": "pascal",
228228
"px": "pcaxis",
229229
"pcode": "peoplecode",
230+
"plantuml": "plant-uml",
230231
"pq": "powerquery",
231232
"mscript": "powerquery",
232233
"pbfasm": "purebasic",

‎plugins/autoloader/prism-autoloader.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎plugins/show-language/prism-show-language.js

+2
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@
187187
"php": "PHP",
188188
"phpdoc": "PHPDoc",
189189
"php-extras": "PHP Extras",
190+
"plant-uml": "PlantUML",
191+
"plantuml": "PlantUML",
190192
"plsql": "PL/SQL",
191193
"powerquery": "PowerQuery",
192194
"pq": "PowerQuery",

‎plugins/show-language/prism-show-language.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,319 @@
1+
-> --> <- <-- <-> <-->
2+
->> -->> <<- <<-- <<->> <<-->>
3+
-/ --/ /- /-- /-/ /--/
4+
-// --// //- //-- //-// //--//
5+
-\ --\ \- \-- \-\ \--\
6+
-\\ --\\ \\- \\-- \\-\\ \\--\\
7+
8+
9+
@startuml
10+
Bob ->x Alice
11+
Bob -> Alice
12+
Bob ->> Alice
13+
Bob -\ Alice
14+
Bob \\- Alice
15+
Bob //-- Alice
16+
17+
Bob ->o Alice
18+
Bob o\\-- Alice
19+
20+
Bob <-> Alice
21+
Bob <->o Alice
22+
@enduml
23+
24+
@startuml
25+
Bob -[#red]> Alice : hello
26+
Alice -[#0000FF]->Bob : ok
27+
@enduml
28+
29+
@startuml
30+
participant Alice
31+
participant Bob #lightblue
32+
Alice -> Bob
33+
Bob -> Carol
34+
...
35+
[-> Bob
36+
[o-> Bob
37+
[o->o Bob
38+
[x-> Bob
39+
...
40+
[<- Bob
41+
[x<- Bob
42+
...
43+
Bob ->]
44+
Bob ->o]
45+
Bob o->o]
46+
Bob ->x]
47+
...
48+
Bob <-]
49+
Bob x<-]
50+
@enduml
51+
52+
@startuml
53+
?-> Alice
54+
[-> Alice
55+
[-> Bob
56+
?-> Bob
57+
Alice ->]
58+
Alice ->?
59+
Alice -> Bob
60+
@enduml
61+
62+
@startuml
63+
(Use case 1) <.. :user:
64+
(Use case 2) <- :user:
65+
@enduml
66+
67+
@startuml
68+
:user: -left-> (dummyLeft)
69+
:user: -right-> (dummyRight)
70+
:user: -up-> (dummyUp)
71+
:user: -down-> (dummyDown)
72+
@enduml
73+
74+
@startuml
75+
Class11 <|.. Class12
76+
Class13 --> Class14
77+
Class15 ..> Class16
78+
Class17 ..|> Class18
79+
Class19 <--* Class20
80+
Class21 #-- Class22
81+
Class23 x-- Class24
82+
Class25 }-- Class26
83+
Class27 +-- Class28
84+
Class29 ^-- Class30
85+
@enduml
86+
87+
----------------------------------------------------
88+
89+
[
90+
["arrow", ["->"]],
91+
["arrow", ["-->"]],
92+
["arrow", ["<-"]],
93+
["arrow", ["<--"]],
94+
["arrow", ["<->"]],
95+
["arrow", ["<-->"]],
96+
97+
["arrow", ["->>"]],
98+
["arrow", ["-->>"]],
99+
["arrow", ["<<-"]],
100+
["arrow", ["<<--"]],
101+
["arrow", ["<<->>"]],
102+
["arrow", ["<<-->>"]],
103+
104+
["arrow", ["-/"]],
105+
["arrow", ["--/"]],
106+
["arrow", ["/-"]],
107+
["arrow", ["/--"]],
108+
["arrow", ["/-/"]],
109+
["arrow", ["/--/"]],
110+
111+
["arrow", ["-//"]],
112+
["arrow", ["--//"]],
113+
["arrow", ["//-"]],
114+
["arrow", ["//--"]],
115+
["arrow", ["//-//"]],
116+
["arrow", ["//--//"]],
117+
118+
["arrow", ["-\\"]],
119+
["arrow", ["--\\"]],
120+
["arrow", ["\\-"]],
121+
["arrow", ["\\--"]],
122+
["arrow", ["\\-\\"]],
123+
["arrow", ["\\--\\"]],
124+
125+
["arrow", ["-\\\\"]],
126+
["arrow", ["--\\\\"]],
127+
["arrow", ["\\\\-"]],
128+
["arrow", ["\\\\--"]],
129+
["arrow", ["\\\\-\\\\"]],
130+
["arrow", ["\\\\--\\\\"]],
131+
132+
["delimiter", "@startuml"],
133+
134+
"\r\nBob ",
135+
["arrow", ["->x"]],
136+
" Alice\r\nBob ",
137+
["arrow", ["->"]],
138+
" Alice\r\nBob ",
139+
["arrow", ["->>"]],
140+
" Alice\r\nBob ",
141+
["arrow", ["-\\"]],
142+
" Alice\r\nBob ",
143+
["arrow", ["\\\\-"]],
144+
" Alice\r\nBob ",
145+
["arrow", ["//--"]],
146+
" Alice\r\n\r\nBob ",
147+
["arrow", ["->o"]],
148+
" Alice\r\nBob ",
149+
["arrow", ["o\\\\--"]],
150+
" Alice\r\n\r\nBob ",
151+
["arrow", ["<->"]],
152+
" Alice\r\nBob ",
153+
["arrow", ["<->o"]],
154+
" Alice\r\n",
155+
156+
["delimiter", "@enduml"],
157+
158+
["delimiter", "@startuml"],
159+
160+
"\r\nBob ",
161+
["arrow", [
162+
"-",
163+
["punctuation", "["],
164+
["expression", [
165+
["color", "#red"]
166+
]],
167+
["punctuation", "]"],
168+
">"
169+
]],
170+
" Alice ",
171+
["punctuation", ":"],
172+
" hello\r\nAlice ",
173+
["arrow", [
174+
"-",
175+
["punctuation", "["],
176+
["expression", [
177+
["color", "#0000FF"]
178+
]],
179+
["punctuation", "]"],
180+
"->"
181+
]],
182+
"Bob ",
183+
["punctuation", ":"],
184+
" ok\r\n",
185+
186+
["delimiter", "@enduml"],
187+
188+
["delimiter", "@startuml"],
189+
["keyword", "participant"],
190+
" Alice\r\n",
191+
["keyword", "participant"],
192+
" Bob ",
193+
["color", "#lightblue"],
194+
"\r\nAlice ",
195+
["arrow", ["->"]],
196+
" Bob\r\nBob ",
197+
["arrow", ["->"]],
198+
" Carol\r\n",
199+
["punctuation", "..."],
200+
["arrow", ["[->"]],
201+
" Bob\r\n",
202+
["arrow", ["[o->"]],
203+
" Bob\r\n",
204+
["arrow", ["[o->o"]],
205+
" Bob\r\n",
206+
["arrow", ["[x->"]],
207+
" Bob\r\n",
208+
["punctuation", "..."],
209+
["arrow", ["[<-"]],
210+
" Bob\r\n",
211+
["arrow", ["[x<-"]],
212+
" Bob\r\n",
213+
["punctuation", "..."],
214+
"\r\nBob ",
215+
["arrow", ["->]"]],
216+
"\r\nBob ",
217+
["arrow", ["->o]"]],
218+
"\r\nBob ",
219+
["arrow", ["o->o]"]],
220+
"\r\nBob ",
221+
["arrow", ["->x]"]],
222+
["punctuation", "..."],
223+
"\r\nBob ",
224+
["arrow", ["<-]"]],
225+
"\r\nBob ",
226+
["arrow", ["x<-]"]],
227+
["delimiter", "@enduml"],
228+
229+
["delimiter", "@startuml"],
230+
["arrow", ["?->"]], " Alice\r\n",
231+
["arrow", ["[->"]], " Alice\r\n",
232+
["arrow", ["[->"]], " Bob\r\n",
233+
["arrow", ["?->"]], " Bob\r\nAlice ", ["arrow", ["->]"]],
234+
"\r\nAlice ", ["arrow", ["->?"]],
235+
"\r\nAlice ", ["arrow", ["->"]], " Bob\r\n",
236+
["delimiter", "@enduml"],
237+
238+
["delimiter", "@startuml"],
239+
240+
["punctuation", "("],
241+
"Use case 1",
242+
["punctuation", ")"],
243+
["arrow", ["<.."]],
244+
["punctuation", ":"],
245+
"user",
246+
["punctuation", ":"],
247+
248+
["punctuation", "("],
249+
"Use case 2",
250+
["punctuation", ")"],
251+
["arrow", ["<-"]],
252+
["punctuation", ":"],
253+
"user",
254+
["punctuation", ":"],
255+
256+
["delimiter", "@enduml"],
257+
258+
["delimiter", "@startuml"],
259+
260+
["punctuation", ":"],
261+
"user",
262+
["punctuation", ":"],
263+
["arrow", ["-left->"]],
264+
["punctuation", "("],
265+
"dummyLeft",
266+
["punctuation", ")"],
267+
268+
["punctuation", ":"],
269+
"user",
270+
["punctuation", ":"],
271+
["arrow", ["-right->"]],
272+
["punctuation", "("],
273+
"dummyRight",
274+
["punctuation", ")"],
275+
276+
["punctuation", ":"],
277+
"user",
278+
["punctuation", ":"],
279+
["arrow", ["-up->"]],
280+
["punctuation", "("],
281+
"dummyUp",
282+
["punctuation", ")"],
283+
284+
["punctuation", ":"],
285+
"user",
286+
["punctuation", ":"],
287+
["arrow", ["-down->"]],
288+
["punctuation", "("],
289+
"dummyDown",
290+
["punctuation", ")"],
291+
292+
["delimiter", "@enduml"],
293+
294+
["delimiter", "@startuml"],
295+
296+
"\r\nClass11 ",
297+
["arrow", ["<|.."]],
298+
" Class12\r\nClass13 ",
299+
["arrow", ["-->"]],
300+
" Class14\r\nClass15 ",
301+
["arrow", ["..>"]],
302+
" Class16\r\nClass17 ",
303+
["arrow", ["..|>"]],
304+
" Class18\r\nClass19 ",
305+
["arrow", ["<--*"]],
306+
" Class20\r\nClass21 ",
307+
["arrow", ["#--"]],
308+
" Class22\r\nClass23 ",
309+
["arrow", ["x--"]],
310+
" Class24\r\nClass25 ",
311+
["arrow", ["}--"]],
312+
" Class26\r\nClass27 ",
313+
["arrow", ["+--"]],
314+
" Class28\r\nClass29 ",
315+
["arrow", ["^--"]],
316+
" Class30\r\n",
317+
318+
["delimiter", "@enduml"]
319+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#palegreen
2+
#gold
3+
#FF00FF
4+
5+
----------------------------------------------------
6+
7+
[
8+
["color", "#palegreen"],
9+
["color", "#gold"],
10+
["color", "#FF00FF"]
11+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
' comment
2+
/'
3+
comment
4+
'/
5+
6+
----------------------------------------------------
7+
8+
[
9+
["comment", "' comment"],
10+
["comment", "/'\r\n comment\r\n'/"]
11+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@startuml
2+
@enduml
3+
4+
----------------------------------------------------
5+
6+
[
7+
["delimiter", "@startuml"],
8+
["delimiter", "@enduml"]
9+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
== Initialization ==
2+
3+
Alice -> Bob: Authentication Request
4+
Bob --> Alice: Authentication Response
5+
6+
== Repetition ==
7+
8+
Alice -> Bob: Another authentication Request
9+
Alice <-- Bob: another authentication Response
10+
11+
----------------------------------------------------
12+
13+
[
14+
["divider", "== Initialization =="],
15+
16+
"\r\n\r\nAlice ",
17+
["arrow", ["->"]],
18+
" Bob",
19+
["punctuation", ":"],
20+
" Authentication Request\r\nBob ",
21+
["arrow", ["-->"]],
22+
" Alice",
23+
["punctuation", ":"],
24+
" Authentication Response\r\n\r\n",
25+
26+
["divider", "== Repetition =="],
27+
28+
"\r\n\r\nAlice ",
29+
["arrow", ["->"]],
30+
" Bob",
31+
["punctuation", ":"],
32+
" Another authentication Request\r\nAlice ",
33+
["arrow", ["<--"]],
34+
" Bob",
35+
["punctuation", ":"],
36+
" another authentication Response"
37+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,337 @@
1+
if "Some Test" then
2+
-->[true] "Some Action"
3+
--> "Another Action"
4+
-right-> (*)
5+
else
6+
->[false] "Something else"
7+
-->[Ending process] (*)
8+
endif
9+
10+
if (Graphviz installed?) then (yes)
11+
:process all\ndiagrams;
12+
else (no)
13+
:process only
14+
__sequence__ and __activity__ diagrams;
15+
endif
16+
17+
if (color?) is (<color:red>red) then
18+
:print red;
19+
else
20+
:print not red;
21+
22+
if (counter?) equals (5) then
23+
:print 5;
24+
else
25+
:print not 5;
26+
27+
start
28+
if (condition A) then (yes)
29+
:Text 1;
30+
elseif (condition B) then (yes)
31+
:Text 2;
32+
stop
33+
(no) elseif (condition C) then (yes)
34+
:Text 3;
35+
(no) elseif (condition D) then (yes)
36+
:Text 4;
37+
else (nothing)
38+
:Text else;
39+
endif
40+
stop
41+
42+
switch (test?)
43+
case ( condition A )
44+
:Text 1;
45+
case ( condition B )
46+
:Text 2;
47+
case ( condition C )
48+
:Text 3;
49+
case ( condition D )
50+
:Text 4;
51+
case ( condition E )
52+
:Text 5;
53+
endswitch
54+
55+
repeat
56+
:read data;
57+
:generate diagrams;
58+
repeat while (more data?) is (yes)
59+
->no;
60+
61+
repeat while (Something went wrong with long text?) is (yes) not (no)
62+
->//merged step//;
63+
64+
----------------------------------------------------
65+
66+
[
67+
["keyword", "if"],
68+
["string", "\"Some Test\""],
69+
["keyword", "then"],
70+
71+
["arrow", ["-->"]],
72+
["punctuation", "["],
73+
"true",
74+
["punctuation", "]"],
75+
["string", "\"Some Action\""],
76+
77+
["arrow", ["-->"]],
78+
["string", "\"Another Action\""],
79+
80+
["arrow", ["-right->"]],
81+
["punctuation", "("],
82+
"*",
83+
["punctuation", ")"],
84+
85+
["keyword", "else"],
86+
87+
["arrow", ["->"]],
88+
["punctuation", "["],
89+
"false",
90+
["punctuation", "]"],
91+
["string", "\"Something else\""],
92+
93+
["arrow", ["-->"]],
94+
["punctuation", "["],
95+
"Ending process",
96+
["punctuation", "]"],
97+
["punctuation", "("],
98+
"*",
99+
["punctuation", ")"],
100+
101+
["keyword", "endif"],
102+
103+
["keyword", "if"],
104+
["punctuation", "("],
105+
"Graphviz installed?",
106+
["punctuation", ")"],
107+
["keyword", "then"],
108+
["punctuation", "("],
109+
"yes",
110+
["punctuation", ")"],
111+
112+
["punctuation", ":"],
113+
"process all\\ndiagrams",
114+
["punctuation", ";"],
115+
116+
["keyword", "else"],
117+
["punctuation", "("],
118+
"no",
119+
["punctuation", ")"],
120+
121+
["punctuation", ":"],
122+
"process only\r\n __sequence__ and __activity__ diagrams",
123+
["punctuation", ";"],
124+
125+
["keyword", "endif"],
126+
127+
["keyword", "if"],
128+
["punctuation", "("],
129+
"color?",
130+
["punctuation", ")"],
131+
["keyword", "is"],
132+
["punctuation", "("],
133+
"<color",
134+
["punctuation", ":"],
135+
"red>red",
136+
["punctuation", ")"],
137+
["keyword", "then"],
138+
139+
["punctuation", ":"],
140+
"print red",
141+
["punctuation", ";"],
142+
143+
["keyword", "else"],
144+
145+
["punctuation", ":"],
146+
"print not red",
147+
["punctuation", ";"],
148+
149+
["keyword", "if"],
150+
["punctuation", "("],
151+
"counter?",
152+
["punctuation", ")"],
153+
["keyword", "equals"],
154+
["punctuation", "("],
155+
"5",
156+
["punctuation", ")"],
157+
["keyword", "then"],
158+
159+
["punctuation", ":"],
160+
"print 5",
161+
["punctuation", ";"],
162+
163+
["keyword", "else"],
164+
165+
["punctuation", ":"],
166+
"print not 5",
167+
["punctuation", ";"],
168+
169+
["keyword", "start"],
170+
171+
["keyword", "if"],
172+
["punctuation", "("],
173+
"condition A",
174+
["punctuation", ")"],
175+
["keyword", "then"],
176+
["punctuation", "("],
177+
"yes",
178+
["punctuation", ")"],
179+
180+
["punctuation", ":"],
181+
"Text 1",
182+
["punctuation", ";"],
183+
184+
["keyword", "elseif"],
185+
["punctuation", "("],
186+
"condition B",
187+
["punctuation", ")"],
188+
["keyword", "then"],
189+
["punctuation", "("],
190+
"yes",
191+
["punctuation", ")"],
192+
193+
["punctuation", ":"],
194+
"Text 2",
195+
["punctuation", ";"],
196+
197+
["keyword", "stop"],
198+
199+
["punctuation", "("],
200+
"no",
201+
["punctuation", ")"],
202+
["keyword", "elseif"],
203+
["punctuation", "("],
204+
"condition C",
205+
["punctuation", ")"],
206+
["keyword", "then"],
207+
["punctuation", "("],
208+
"yes",
209+
["punctuation", ")"],
210+
211+
["punctuation", ":"],
212+
"Text 3",
213+
["punctuation", ";"],
214+
215+
["punctuation", "("],
216+
"no",
217+
["punctuation", ")"],
218+
["keyword", "elseif"],
219+
["punctuation", "("],
220+
"condition D",
221+
["punctuation", ")"],
222+
["keyword", "then"],
223+
["punctuation", "("],
224+
"yes",
225+
["punctuation", ")"],
226+
227+
["punctuation", ":"],
228+
"Text 4",
229+
["punctuation", ";"],
230+
231+
["keyword", "else"],
232+
["punctuation", "("],
233+
"nothing",
234+
["punctuation", ")"],
235+
236+
["punctuation", ":"],
237+
"Text else",
238+
["punctuation", ";"],
239+
240+
["keyword", "endif"],
241+
242+
["keyword", "stop"],
243+
244+
["keyword", "switch"],
245+
["punctuation", "("],
246+
"test?",
247+
["punctuation", ")"],
248+
249+
["keyword", "case"],
250+
["punctuation", "("],
251+
" condition A ",
252+
["punctuation", ")"],
253+
254+
["punctuation", ":"],
255+
"Text 1",
256+
["punctuation", ";"],
257+
258+
["keyword", "case"],
259+
["punctuation", "("],
260+
" condition B ",
261+
["punctuation", ")"],
262+
263+
["punctuation", ":"],
264+
"Text 2",
265+
["punctuation", ";"],
266+
267+
["keyword", "case"],
268+
["punctuation", "("],
269+
" condition C ",
270+
["punctuation", ")"],
271+
272+
["punctuation", ":"],
273+
"Text 3",
274+
["punctuation", ";"],
275+
276+
["keyword", "case"],
277+
["punctuation", "("],
278+
" condition D ",
279+
["punctuation", ")"],
280+
281+
["punctuation", ":"],
282+
"Text 4",
283+
["punctuation", ";"],
284+
285+
["keyword", "case"],
286+
["punctuation", "("],
287+
" condition E ",
288+
["punctuation", ")"],
289+
290+
["punctuation", ":"],
291+
"Text 5",
292+
["punctuation", ";"],
293+
294+
["keyword", "endswitch"],
295+
296+
["keyword", "repeat"],
297+
298+
["punctuation", ":"],
299+
"read data",
300+
["punctuation", ";"],
301+
302+
["punctuation", ":"],
303+
"generate diagrams",
304+
["punctuation", ";"],
305+
306+
["keyword", "repeat"],
307+
["keyword", "while"],
308+
["punctuation", "("],
309+
"more data?",
310+
["punctuation", ")"],
311+
["keyword", "is"],
312+
["punctuation", "("],
313+
"yes",
314+
["punctuation", ")"],
315+
316+
["arrow", ["->"]],
317+
"no",
318+
["punctuation", ";"],
319+
320+
["keyword", "repeat"],
321+
["keyword", "while"],
322+
["punctuation", "("],
323+
"Something went wrong with long text?",
324+
["punctuation", ")"],
325+
["keyword", "is"],
326+
["punctuation", "("],
327+
"yes",
328+
["punctuation", ")"],
329+
["keyword", "not"],
330+
["punctuation", "("],
331+
"no",
332+
["punctuation", ")"],
333+
334+
["arrow", ["->"]],
335+
"//merged step//",
336+
["punctuation", ";"]
337+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
!pragma useVerticalIf on
2+
3+
----------------------------------------------------
4+
5+
[
6+
["preprocessor", ["!pragma useVerticalIf on"]]
7+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"foo"
2+
""
3+
4+
----------------------------------------------------
5+
6+
[
7+
["string", "\"foo\""],
8+
["string", "\"\""]
9+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Alice -> Bob: Authentication request
2+
Bob --> Alice: Response
3+
4+
participant Participant [
5+
=Title
6+
----
7+
""SubTitle""
8+
]
9+
10+
----------------------------------------------------
11+
12+
[
13+
"Alice ",
14+
["arrow", ["->"]],
15+
" Bob",
16+
["punctuation", ":"],
17+
" Authentication request\r\nBob ",
18+
["arrow", ["-->"]],
19+
" Alice",
20+
["punctuation", ":"],
21+
" Response\r\n\r\n",
22+
23+
["keyword", "participant"],
24+
" Participant ",
25+
["punctuation", "["],
26+
27+
["text", " =Title\r\n ----\r\n \"\"SubTitle\"\"\r\n"],
28+
["punctuation", "]"]
29+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
@startuml
2+
clock clk with period 1
3+
binary "enable" as EN
4+
concise "dataBus" as db
5+
6+
@0 as :start
7+
@5 as :en_high
8+
@10 as :en_low
9+
@:en_high-2 as :en_highMinus2
10+
11+
@:start
12+
EN is low
13+
db is "0x0000"
14+
15+
@:en_high
16+
EN is high
17+
18+
@:en_low
19+
EN is low
20+
21+
@:en_highMinus2
22+
db is "0xf23a"
23+
24+
@:en_high+6
25+
db is "0x0000"
26+
@enduml
27+
28+
@1:15:00
29+
@2000/12/31
30+
31+
----------------------------------------------------
32+
33+
[
34+
["delimiter", "@startuml"],
35+
36+
["keyword", "clock"],
37+
" clk with period 1\r\n",
38+
39+
["keyword", "binary"],
40+
["string", "\"enable\""],
41+
["keyword", "as"],
42+
" EN\r\n",
43+
44+
["keyword", "concise"],
45+
["string", "\"dataBus\""],
46+
["keyword", "as"],
47+
" db\r\n\r\n",
48+
49+
["time", "@0"],
50+
["keyword", "as"],
51+
["punctuation", ":"],
52+
"start\r\n",
53+
54+
["time", "@5"],
55+
["keyword", "as"],
56+
["punctuation", ":"],
57+
"en_high\r\n",
58+
59+
["time", "@10"],
60+
["keyword", "as"],
61+
["punctuation", ":"],
62+
"en_low\r\n",
63+
64+
["time", "@:en_high-2"],
65+
["keyword", "as"],
66+
["punctuation", ":"],
67+
"en_highMinus2\r\n\r\n",
68+
69+
["time", "@:start"],
70+
71+
"\r\nEN ",
72+
["keyword", "is"],
73+
" low\r\ndb ",
74+
["keyword", "is"],
75+
["string", "\"0x0000\""],
76+
77+
["time", "@:en_high"],
78+
"\r\nEN ", ["keyword", "is"], " high\r\n\r\n",
79+
80+
["time", "@:en_low"],
81+
"\r\nEN ", ["keyword", "is"], " low\r\n\r\n",
82+
83+
["time", "@:en_highMinus2"],
84+
"\r\ndb ", ["keyword", "is"], ["string", "\"0xf23a\""],
85+
86+
["time", "@:en_high+6"],
87+
"\r\ndb ", ["keyword", "is"], ["string", "\"0x0000\""],
88+
["delimiter", "@enduml"],
89+
90+
["time", "@1:15:00"],
91+
["time", "@2000/12/31"]
92+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
$foo
2+
$bar
3+
4+
%autonumber%
5+
%page%
6+
7+
----------------------------------------------------
8+
9+
[
10+
["variable", "$foo"],
11+
["variable", "$bar"],
12+
13+
["variable", "%autonumber%"],
14+
["variable", "%page%"]
15+
]

0 commit comments

Comments
 (0)
Please sign in to comment.