-
Notifications
You must be signed in to change notification settings - Fork 0
/
uml.sno
executable file
·40 lines (29 loc) · 858 Bytes
/
uml.sno
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/local/bin/snobol4 -b
&anchor = 1
float = span("0123456789.")
count = 0
lineno = 1
loop line = input :f(end)
line ".lf " float . lineno :s(next)
line ".UML" rem . options :s(pipe)
lineno = lineno + 1
next output = line :(loop)
pipe filename = "uml_temp" (count = count + 1) ".pdf"
output(.pipe, 100,,
+ "| plantuml -pipe -tsvg -failonerror -config plantuml.cfg | "
+ "rsvg-convert -f pdf -o " filename)
pipe = "@startuml"
pipe_l line = input
lineno = lineno + 1
line ".UML" :s(close)
pipe = line :(pipe_l)
close pipe = "@enduml"
endfile(100)
* get PDF dimensions
input(.pipe, 100,, "|pdfinfo " filename)
get_info
pipe "Page size:" span(" ") float . width " x " float . height :f(get_info)
endfile(100)
output = ".PDF_IMAGE " filename " " width "p " height "p" options
output = ".lf " (lineno + 1) :(loop)
end