From 1557dabea23a31b9693af4e8f437165c11d8d657 Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Mon, 7 Jun 2021 00:18:24 -0400 Subject: [PATCH] jam-tuesday: Replace all-songs listing with by-artist table I'm really happy with how this turned out, much more readable than the all-songs-alphabetical view from before! --- bin/jam-index.sh | 28 ++++++++++++++++++++++------ style.css | 7 +++++++ 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/bin/jam-index.sh b/bin/jam-index.sh index 0a637ca..5d54ff1 100755 --- a/bin/jam-index.sh +++ b/bin/jam-index.sh @@ -3,6 +3,12 @@ set -e REPO=$(dirname "$(dirname "$0")") DIR="$REPO/jam-tuesday" +# Prep for the by artist listing +ALL=$(mktemp) +for f in "$DIR"/[01][0-9]-*; do + sed '1,/---/d' $f | grep -v '^ *$' | sed 's/ *([^)]*) *//g' +done | sort -f > "$ALL" + cat < @@ -54,15 +60,25 @@ done cat < -

All Songs, Alphabetical

+

All Songs, by Artist


-
    + + EOM -for f in "$DIR"/[01][0-9]-*; do - sed '1,/---/d' $f | grep -v '^ *$' | sed 's/ *([^)]*) *//g' -done | sort -f | uniq -i -c | sed 's/ *\([0-9]*\) *\(.*\)/
  • \2 (\1)<\/li>/' +sed 's/.*, *//' "$ALL" | sort -u -f | while read artist; do + first="" + grep ", *$artist\$" "$ALL" | sort -f | sed "s#, *$artist *##" | uniq -c -i | \ + while read plays song; do + if [ -z "$first" ]; then + first=1 + echo "
  • " + else + echo "" + fi + done +done cat < +
    ArtistSongPlays
    $artist$song$plays
    $song$plays


    Last Updated: $(date)

    diff --git a/style.css b/style.css index 7071163..30ba849 100644 --- a/style.css +++ b/style.css @@ -71,3 +71,10 @@ td.head-rtitle, td.foot-os { text-align: right; } code.Nm, .Fl, .Cm, .Ic, code.In, .Fd, .Fn, .Cd { font-weight: bold; } + +.jam-artists tr:nth-child(even) { + background-color: #e3e3e3; +} +td.jam-artists, th.jam-artists, table.jam-artists { + border: 1px solid black; +} -- libgit2 1.1.1