gamelog/justfile

64 lines
1.7 KiB
Plaintext
Raw Normal View History

2022-02-11 22:08:17 +00:00
database := "db/games.rec"
2021-12-23 21:52:43 +00:00
# show all commands
default:
just -l --unsorted
# how many games played
played:
2022-02-11 22:08:17 +00:00
recsel -e "Role = 'Player'" -P Module {{database}}
2021-12-23 21:52:43 +00:00
# how many games ran
ran:
2022-02-11 22:08:17 +00:00
recsel -e "Role = 'DM'" -P Module {{database}}
2021-12-23 21:52:43 +00:00
# ongoing
ongoing:
2022-02-11 22:08:17 +00:00
recsel -e 'Status = "Ongoing"' -p System,Module {{database}}
2021-12-23 21:52:43 +00:00
2022-08-30 13:17:56 +00:00
# show all in year
year x:
recsel -e 'Updated >> "{{x}}-01-01"' -P "Module,System,Updated" {{database}}
2021-12-23 21:52:43 +00:00
# export csv
csv:
2022-02-11 22:08:17 +00:00
rec2csv {{database}}
2021-12-23 21:52:43 +00:00
# get some json
json:
2022-02-11 22:08:17 +00:00
rec2csv {{database}} | csvjson | jq
2021-12-23 21:52:43 +00:00
2022-02-11 04:26:27 +00:00
# create a new entry
2021-12-23 21:52:43 +00:00
new:
node bin/cli.js
2022-01-06 23:43:11 +00:00
2022-02-11 22:08:17 +00:00
# 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
2022-02-11 04:26:27 +00:00
html:
2022-03-04 22:40:05 +00:00
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
2022-02-11 04:26:27 +00:00
# rss feed
feed:
2022-02-11 22:08:17 +00:00
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
2022-03-04 23:01:03 +00:00
sed -i '' 's/&/and/g' dist/feed.xml
2022-02-11 22:08:17 +00:00
2022-02-17 00:45:28 +00:00
# copy to blog
export:
just html && cp dist/index.html ../dozens-and-dragons/out/gamelog/
2022-02-11 22:08:17 +00:00
# DO THE THANG
build: html feed
# upload
2022-02-17 00:45:28 +00:00
up: build export
2022-02-11 22:08:17 +00:00
rsync -azP --exclude=.git dist/* tilde:public_html/gamelog
2022-08-30 13:17:56 +00:00
# do everything
all: build up