From 60daaff65a306082d335feac58c52ec39bf36f85 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Fri, 9 Jun 2023 00:46:16 +0200 Subject: Add pages for specific denominations --- build | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 101 insertions(+), 7 deletions(-) (limited to 'build') diff --git a/build b/build index 1616f37..1b258a0 100755 --- a/build +++ b/build @@ -35,11 +35,12 @@ compile_for_lang() { s||| '" \ | while read file; do - xfsub '' $od/nav-bar.html $file - xfsub '' $od/euro/coin-nav.html $file - xfsub '' $od/euro/note-nav.html $file - xfsub '' $od/footer.html $file - xfsub '' $od/table-key.html $file + xfsub '' $od/nav-bar.html $file + xfsub '' $od/euro/coin-nav.html $file + xfsub '' $od/euro/note-nav.html $file + xfsub '' $od/euro/coin-denom-nav.html $file + xfsub '' $od/footer.html $file + xfsub '' $od/table-key.html $file done for file in `find $od -name 'index.html'`; do @@ -178,11 +179,11 @@ compile_for_lang() { done for denom in `grep -Eo '^[0-9]+' data/notes | uniq`; do - nod=$od/euro/$denom + nod=$od/euro/${denom}e mkdir -p $nod cp $od/euro/notes.template.html $nod/index.html sed -Ei " - /|s|([^<]*)|
\\1
| + /|s|([^<]*)|
\\1
| " $nod/index.html sed -i "s//$denom/" $nod/index.html @@ -306,6 +307,98 @@ compile_for_lang() { | xfsub '' - $nod/index.html done + # We will need this later… + { for CC in `grep -Eo '^[A-Z]{2}' data/coins | uniq`; do + grep "^$CC " data/country-info.$1 | cut -f1,3 + done } | sort >data/tmp-data.$1 + + + for denom in 1 2 5 10 20 50 100 200; do + if [ $denom -eq 100 -o $denom -eq 200 ]; then + denom_=${denom%00}e + else + denom_=${denom}c + fi + nod=$od/euro/$denom_ + mkdir -p $nod + cp $od/euro/coins-denom.template.html $nod/index.html + sed -Ei " + /|s|([^<]*)|
\\1
| + " $nod/index.html + if [ $denom -eq 100 -o $denom -eq 200 ]; then + sed -i "s//${denom%00}.00/" $nod/index.html + else + sed -i "s//0.`printf '%02d' $denom`/" $nod/index.html + fi + + for CC in `cut -f1 data/tmp-data.$1`; do + gawk -v CC=$CC -v lang=$1 -v denom=$denom ' + @include "scripts/getcls.awk" + + FILENAME ~ /data\/tmp-data\.[a-z]{2}/ && $1 == CC { + gsub(/^.../, "") + print "
" + print "
" + print "" + print "" + print "" + } + + $1 == CC && /.. start/ { + sub(/.. start/, "") + printf "\n", $0 + next + } + + $1 == CC { + y = $10 + if ($11 != "") + y_ = $11 + printf "" + + if (denom == 1) i = 2 + else if (denom == 2) i = 3 + else if (denom == 5) i = 4 + else if (denom == 10) i = 5 + else if (denom == 20) i = 6 + else if (denom == 50) i = 7 + else if (denom == 100) i = 8 + else if (denom == 200) i = 9 + + # 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 ($i != "/") { + if ($11 != "") { + printf "", + getcls($i), y, y_ + } else + printf "", getcls($i), y + } + print "" + } + + END { + print "MARKER LOL" + print "
" $0 "
%s
%s %s%s
" + print "MARKER LMAO" + } + ' data/tmp-data.$1 data/coins \ + | last-of-design.sed \ + | sed -E 's|()[^<]*([^<]*)?()|\1\3|g' \ + | fsub '' - $nod/index.html \ + | sed 's/MARKER LMAO//' \ + | sponge $nod/index.html + done + done + for file in `find $od -name '*.html'`; do path=${file#out/??} path=${path%/*.html} @@ -319,3 +412,4 @@ done wait find out -name '*.html' -and -not -name 'index.html' -delete +rm data/tmp-data.?? -- cgit v1.2.3