diff options
author | Thomas Voss <mail@thomasvoss.com> | 2023-10-29 22:39:48 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2023-10-29 22:39:48 +0100 |
commit | 9cad508b5c98ca1029460807249cafb712f28f1e (patch) | |
tree | 2ad62d1ca57b7dc691550865cb7fb0b55c26da34 /scripts/gen-scoin | |
parent | c88b4c2d0842dfbb32fa744dde781601b9e4e7cf (diff) |
Migrate the site to GSP and a Makefile
Diffstat (limited to 'scripts/gen-scoin')
-rwxr-xr-x | scripts/gen-scoin | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/scripts/gen-scoin b/scripts/gen-scoin new file mode 100755 index 0000000..e7e7982 --- /dev/null +++ b/scripts/gen-scoin @@ -0,0 +1,48 @@ +#!/bin/sh + +gawk -v CC=$1 ' +@include "scripts/getcls.awk" + +BEGIN { + CC = toupper(CC) +} + +$1 == CC && /.. start/ { + sub(/^.. start/, ""); + sub(/^ /, "") + printf "tr .new-design {th colspan=\"8\" {-%s}}\n", $0 + next +} + +$1 == CC { + y = $10 + if ($11 != "") { + y_ = $11 + for (i = 12; i <= NF; i++) + y_ = y_ " " $i + } + printf "trX {" + for (i = 2; i <= 9; i++) { + # Greece 2002 needs special handling + if (CC == "GR" && $10 == 2002 && $11 == "MM") { + if (i <= 5) + y_ = "F" + else if (i <= 7) + y_ = "E" + else + y_ = "S" + } + + if ($11 != "") + printf "td .%s {-%s @sup{-%s}}", getcls($i), y, y_ + else + printf "td .%s {-%s}", getcls($i), y + } + print "}" +} + +END { + print "__MARKER__" +} +' data/coins \ +| scripts/last-of-design.sed |