aboutsummaryrefslogtreecommitdiff
path: root/uml.sno
blob: 9461884319ce261e591f0170e9cd4011ae2a27ec (plain)
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
40
#!/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