57 lines
1.6 KiB
Plaintext
57 lines
1.6 KiB
Plaintext
database := "db/games.rec"
|
|
|
|
# show all commands
|
|
default:
|
|
just -l --unsorted
|
|
|
|
# how many games played
|
|
played:
|
|
recsel -e "Role = 'Player'" -P Module {{database}}
|
|
|
|
# how many games ran
|
|
ran:
|
|
recsel -e "Role = 'DM'" -P Module {{database}}
|
|
|
|
# ongoing
|
|
ongoing:
|
|
recsel -e 'Status = "Ongoing"' -p System,Module {{database}}
|
|
|
|
# export csv
|
|
csv:
|
|
rec2csv {{database}}
|
|
|
|
# get some json
|
|
json:
|
|
rec2csv {{database}} | csvjson | jq
|
|
|
|
# create a new entry
|
|
new:
|
|
node bin/cli.js
|
|
|
|
# featuring descending sort!
|
|
markdown:
|
|
recsel -S Updated {{database}} | rec2csv | csvjson | jq 'reverse | map(.Notes |= gsub("\n"; "\n\n"))' | in2csv -f json | csv2rec | recfmt -f templates/markdown.template
|
|
|
|
# html out
|
|
html:
|
|
just markdown | pandoc -t html --toc -s --metadata title="Games!" --metadata toc-title="Index" -B templates/before.html -A templates/after.html -H templates/header.html -o dist/index.html
|
|
|
|
# rss feed
|
|
feed:
|
|
echo "<rss version=\"2.0\"><channel><title>gamelog</title>" > dist/feed.xml
|
|
echo "<link>http://tilde.town/~dozens/gamelog/index.html</link><description>all the games i play</description><atom:link rel=\"self\" type=\"application/rss+xml\" href=\"http://tilde.town/~dozens/gamelog/feed.xml\"/>" >> dist/feed.xml
|
|
recsel {{database}} | recfmt -f templates/feed.template >> dist/feed.xml
|
|
echo '</channel></rss>' >> dist/feed.xml
|
|
sed -i '' 's/&/and/g' dist/feed.xml
|
|
|
|
# copy to blog
|
|
export:
|
|
just html && cp dist/index.html ../dozens-and-dragons/out/gamelog/
|
|
|
|
# DO THE THANG
|
|
build: html feed
|
|
|
|
# upload
|
|
up: build export
|
|
rsync -azP --exclude=.git dist/* tilde:public_html/gamelog
|