summaryrefslogtreecommitdiffhomepage
path: root/scripts/gen-notes-ez
blob: 68d09a7ac3435b06dae337c664a99e204807c0bb (plain) (blame)
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
#!/bin/sh

# Europa	50	X

gawk -v S=$1 '
@include "scripts/getcls.awk"

$1 == S {
	data[$2] = $3
	indices[++i] = $2
}

END {
	asort(indices)
	for (i = 1; i <= length(indices); i++) {
		x = i % 4
		if (x == 1)
			printf "trX {"

		printf "td .%s colspan=\"X\" {-€%d}", getcls(data[indices[i]]), indices[i]

		if (x == 0) {
			print "}"
			ends++
		}
	}

	if ((length(data) / 4) > ends)
		print "}"

	print "__MARKER__"
}
' data/world/notes.ez \
| scripts/colspan.sed \
| scripts/last-of-design.sed