#!/bin/zsh database="db/games.rec" ## BEGIN: TEMPLATES ## gameheadertmpl='

{{Module}} ({{System}}) #

{{Module}} is a game of {{System}} that I started playing on {{Started}} as a {{Role}}. It is a {{Format}} {{Length}} and is currently {{Status}}.

Here is how it went!

' updatetmpl='

{{Created}} #

{{Text}} ' updateupdatetmpl='

{{Created}} {{Game_System}}: {{Game_Module}}#

{{Text}} ' gamefootertmpl='
🎲🎲
' toctmpl='
  • {{Module}} ({{System}})
  • ' ## END: TEMPLATES ## BEGIN=$( cat< The Most Interesting Thing That Happened To Me Today

    Gamelogs

    All the roleplaying games I\'ve played.

  • src: https://git.tilde.town/dozens/gamelog
  • dozens webring: previous index next
  • rss
  • View by: Game Update

    EOF ) END=$( cat<<'END-OF-END'
    END-OF-END ) ## INDEX (View by Game) ## exec > dist/index.html echo $BEGIN echo '

    Contents

    ' recsel $database -t Game | recfmt "$toctmpl" allgames=(`recsel $database -t Game -P Id -C | tr '\n' ' '`) for idx in "${allgames[@]}" do recsel $database -t Game -e "Id = $idx" \ | recfmt "$gameheadertmpl" recsel $database -t Update -e "Game = $idx" \ | recfmt "$updatetmpl" | markdown echo $gamefootertmpl done echo $END ## UPDATE (View by Update) ## exec > dist/updates.html echo $BEGIN recsel db/games.rec -t Update -j Game \ | awk ' BEGIN { RS="";FS="\n" } { rec[NR] = $0 } END { for (i=length(rec);i>0;i--) { print rec[i]; print ""; } }' \ | recfmt "$updateupdatetmpl" \ | markdown echo $END