From a0267d7afff488465d723d480f3b095a1ebfef9d Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Mon, 30 Oct 2023 00:20:08 +0100 Subject: Make presidential dollars page better --- scripts/gen-pres | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/gen-pres b/scripts/gen-pres index a1e7cb1..fbe1b5d 100755 --- a/scripts/gen-pres +++ b/scripts/gen-pres @@ -3,15 +3,32 @@ gawk ' @include "scripts/getcls.awk" +function getsup(i, s) +{ + switch (i) { + case 1: + s = "D" + break + case 2: + s = "P" + break + case 3: + s = "S" + break + } + + return "@sup{-" s "}" +} + BEGIN { FS = "\t" } { - printf "trX { td .missing colspan=\"1\" {-%s}", $1 + printf "trX { td .missing colspan=\"2\" {-%s}", $3 split($2, a, / /) for (i = 1; i <= length(a); i++) - printf "td .%s colspan=\"2\" {-%s}", getcls(a[i]), $3 + printf "td .%s colspan=\"1\" {-%s%s}", getcls(a[i]), $1, getsup(i) print "}" } -- cgit v1.2.3