summaryrefslogtreecommitdiffhomepage
path: root/build
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-06-09 00:46:16 +0200
committerThomas Voss <mail@thomasvoss.com> 2023-06-09 00:46:16 +0200
commit60daaff65a306082d335feac58c52ec39bf36f85 (patch)
tree11b3fb8274d190c822c8a55914ec69c1f060e682 /build
parent3701a2c84534fc6c4a00a0466ff2cc36874d4328 (diff)
Add pages for specific denominations
Diffstat (limited to 'build')
-rwxr-xr-xbuild108
1 files changed, 101 insertions, 7 deletions
diff --git a/build b/build
index 1616f37..1b258a0 100755
--- a/build
+++ b/build
@@ -35,11 +35,12 @@ compile_for_lang() {
s|<html lang=XX>|<html lang=$1>|
'" \
| while read file; do
- xfsub '<!-- NAV-BAR -->' $od/nav-bar.html $file
- xfsub '<!-- COIN-NAV -->' $od/euro/coin-nav.html $file
- xfsub '<!-- NOTE-NAV -->' $od/euro/note-nav.html $file
- xfsub '<!-- FOOTER -->' $od/footer.html $file
- xfsub '<!-- TABLE-KEY -->' $od/table-key.html $file
+ xfsub '<!-- NAV-BAR -->' $od/nav-bar.html $file
+ xfsub '<!-- COIN-NAV -->' $od/euro/coin-nav.html $file
+ xfsub '<!-- NOTE-NAV -->' $od/euro/note-nav.html $file
+ xfsub '<!-- COIN-DENOM-NAV -->' $od/euro/coin-denom-nav.html $file
+ xfsub '<!-- FOOTER -->' $od/footer.html $file
+ xfsub '<!-- TABLE-KEY -->' $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 "
- /<nav>/,\\|</nav>|s|<a href=/../euro/$denom>([^<]*)</a>|<div class=selected>\\1</div>|
+ /<nav>/,\\|</nav>|s|<a href=/../euro/${denom}e>([^<]*)</a>|<div class=selected>\\1</div>|
" $nod/index.html
sed -i "s/<!-- DENOM -->/$denom/" $nod/index.html
@@ -306,6 +307,98 @@ compile_for_lang() {
| xfsub '<!-- EUROPA-TABLE-BODY -->' - $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 "
+ /<nav>/,\\|</nav>|s|<a href=/../euro/${denom_}>([^<]*)</a>|<div class=selected>\\1</div>|
+ " $nod/index.html
+ if [ $denom -eq 100 -o $denom -eq 200 ]; then
+ sed -i "s/<!-- DENOM -->/${denom%00}.00/" $nod/index.html
+ else
+ sed -i "s/<!-- DENOM -->/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 "<section class=\"cl-section slant-down\">"
+ print "<div>"
+ print "<table class=coin-table cellspacing=0>"
+ print "<thead><tr><th>" $0 "</th></tr></thead>"
+ print "<tbody>"
+ }
+
+ $1 == CC && /.. start/ {
+ sub(/.. start/, "")
+ printf "<tr class=new-design><th>%s</th></tr>\n", $0
+ next
+ }
+
+ $1 == CC {
+ y = $10
+ if ($11 != "")
+ y_ = $11
+ printf "<trX>"
+
+ 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 "<td class=%s>%s <sup>%s</sup></td>",
+ getcls($i), y, y_
+ } else
+ printf "<td class=%s>%s</td>", getcls($i), y
+ }
+ print "</tr>"
+ }
+
+ END {
+ print "MARKER LOL"
+ print "</tbody></table></div></section>"
+ print "MARKER LMAO"
+ }
+ ' data/tmp-data.$1 data/coins \
+ | last-of-design.sed \
+ | sed -E 's|(<td class=not-minted>)[^<]*(<sup>[^<]*</sup>)?(</td>)|\1\3|g' \
+ | fsub '<!-- DENOM-TABLE -->' - $nod/index.html \
+ | sed 's/MARKER LMAO/<!-- DENOM-TABLE -->/' \
+ | 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.??