summaryrefslogtreecommitdiffhomepage
path: root/scripts/gen-europa
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-10-29 22:39:48 +0100
committerThomas Voss <mail@thomasvoss.com> 2023-10-29 22:39:48 +0100
commit9cad508b5c98ca1029460807249cafb712f28f1e (patch)
tree2ad62d1ca57b7dc691550865cb7fb0b55c26da34 /scripts/gen-europa
parentc88b4c2d0842dfbb32fa744dde781601b9e4e7cf (diff)
Migrate the site to GSP and a Makefile
Diffstat (limited to 'scripts/gen-europa')
-rwxr-xr-xscripts/gen-europa71
1 files changed, 71 insertions, 0 deletions
diff --git a/scripts/gen-europa b/scripts/gen-europa
new file mode 100755
index 0000000..48d05f9
--- /dev/null
+++ b/scripts/gen-europa
@@ -0,0 +1,71 @@
+#!/bin/sh
+
+gawk -v denom=$1 '
+@include "scripts/getcls.awk"
+
+BEGIN {
+ FS = "\t"
+}
+
+FILENAME == "data/country-info" {
+ cc2name[$1] = $3
+}
+
+FILENAME == "data/note-info" && length == 0 {
+ section++
+ next
+}
+
+FILENAME == "data/note-info" && section == 0 {
+ cc2c[$1] = $2
+}
+
+FILENAME == "data/note-info" && section == 1 {
+ ab2l[$1] = $2
+}
+
+FILENAME == "data/notes" && $1 == denom && $2 == "Europa" {
+ i++
+ col[i][0] = $3
+ col[i][1] = $4
+}
+
+END {
+ asort(col)
+ for (i = 1; i <= 2; i++) {
+ switch (i) {
+ case 1:
+ sig = "Mario Draghi"
+ break
+ case 2:
+ sig = "Christine Lagarde"
+ break
+ }
+
+ printf "tr .new-design {th colspan=\"12\" {-%s}}\n", sig
+ c = 0
+
+ for (j = 1; j <= length(col); j++) {
+ split(col[j][1], s, " ")
+ if (s[i] == "/")
+ continue
+
+ if (c % 4 == 0)
+ printf "trX {"
+
+ printf "td colspan=\"X\" .%s {-%s (%s)}", getcls(s[i]),
+ cc2name[col[j][0]], cc2c[col[j][0]]
+
+ if (c % 4 == 3 && j < length(col))
+ print "}"
+ if (c % 4 != 3 || j != length(col))
+ c++
+ }
+ if ((c - 1) % 4 != 3)
+ print "}"
+ }
+ print "__MARKER__"
+}
+' data/country-info data/note-info data/notes \
+| scripts/colspan.sed \
+| scripts/last-of-design.sed