Compare commits
No commits in common. "8c05ac2b3db4d20166f691e85bcb542ab5139f9b" and "801a09dc4c6c86a4e61d92e5dd00ce1cdabdea17" have entirely different histories.
8c05ac2b3d
...
801a09dc4c
1323
db/games.rec
1323
db/games.rec
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
117
justfile
117
justfile
|
@ -5,113 +5,47 @@ default:
|
||||||
just -l --unsorted
|
just -l --unsorted
|
||||||
|
|
||||||
# how many games played
|
# how many games played
|
||||||
@played:
|
played:
|
||||||
recsel -t Game -e "Role = 'Player'" -P Module -C {{database}}
|
recsel -e "Role = 'Player'" -P Module {{database}}
|
||||||
|
|
||||||
# how many games ran
|
# how many games ran
|
||||||
@ran:
|
ran:
|
||||||
recsel -t Game -e "Role = 'DM'" -P Module -C {{database}}
|
recsel -e "Role = 'DM'" -P Module {{database}}
|
||||||
|
|
||||||
# ongoing
|
# ongoing
|
||||||
@ongoing:
|
ongoing:
|
||||||
recsel -t Game -e 'Status = "Ongoing"' -p System,Module {{database}}
|
recsel -e 'Status = "Ongoing"' -p System,Module {{database}}
|
||||||
|
|
||||||
# show all in year
|
# show all in year
|
||||||
year x:
|
year x:
|
||||||
recsel -t Game -e 'Updated >> "{{x}}-01-01"' -P "Module,System,Updated" {{database}}
|
recsel -e 'Updated >> "{{x}}-01-01"' -P "Module,System,Updated" {{database}}
|
||||||
|
|
||||||
|
# export csv
|
||||||
|
csv:
|
||||||
|
rec2csv {{database}}
|
||||||
|
|
||||||
|
# get some json
|
||||||
|
json:
|
||||||
|
rec2csv {{database}} | csvjson | jq
|
||||||
|
|
||||||
# create a new entry
|
# create a new entry
|
||||||
new:
|
new:
|
||||||
node bin/cli.js
|
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:
|
html:
|
||||||
#!/usr/bin/env sh
|
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
|
||||||
## BEGIN: TEMPLATES ##
|
|
||||||
gameheadertmpl='<article>
|
|
||||||
<h2 id={{{{Id}}>{{{{Module}} ({{{{System}})</h2>
|
|
||||||
<p>{{{{Module}} is a game of {{{{System}} that I started playing on {{{{Started}} as a {{{{Role}}. It is a {{{{Format}} {{{{Length}} and is currently {{{{Status}}.</p>
|
|
||||||
<p>Here is how it went!</p>
|
|
||||||
'
|
|
||||||
|
|
||||||
updatetmpl='<h3>{{{{Created}}</h3>
|
|
||||||
|
|
||||||
{{{{Text}}
|
|
||||||
'
|
|
||||||
|
|
||||||
gamefootertmpl='<center>🎲🎲</center>
|
|
||||||
</article>'
|
|
||||||
|
|
||||||
toctmpl='<li><a href="#{{{{Id}}">{{{{Module}} ({{{{System}})</a></li>'
|
|
||||||
## END: TEMPLATES ##
|
|
||||||
|
|
||||||
exec > dist/index.html
|
|
||||||
|
|
||||||
## BEGIN: STYLE ##
|
|
||||||
cat<<EOF
|
|
||||||
<link rel="alternate" type="application/rss+xml" href="feed.xml" title="dozens gamelog">
|
|
||||||
<style>
|
|
||||||
body {
|
|
||||||
max-width: 80ch;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
h2 {
|
|
||||||
border-bottom: solid 1px black;
|
|
||||||
margin-top: 3rem;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
EOF
|
|
||||||
## END: STYLE ##
|
|
||||||
|
|
||||||
## BEGIN: INTRO ##
|
|
||||||
cat<<EOF
|
|
||||||
<h1>Games!</h1>
|
|
||||||
<li>src: <a href='https://git.tilde.town/dozens/gamelog'>https://git.tilde.town/dozens/gamelog</a></li>
|
|
||||||
<li>dozens webring: <a href='https://tilde.town/%7Edozens/webring/dozens/index.html?name=gamelog&dir=prev'>previous</a> <a href='https://tilde.town/%7Edozens/webring/dozens/index.html'>index</a> <a href='https://tilde.town/%7Edozens/webring/dozens/index.html?name=gamelog&dir=next'>next</a></li>
|
|
||||||
<li><a href="feed.xml">rss</a></li>
|
|
||||||
EOF
|
|
||||||
## END: INTRO ##
|
|
||||||
|
|
||||||
## BEGIN: TOC ##
|
|
||||||
echo '<h2>Contents</h2>'
|
|
||||||
recsel {{database}} -t Game | recfmt "$toctmpl"
|
|
||||||
## END: TOC ##
|
|
||||||
|
|
||||||
## BEGIN: BODY ##
|
|
||||||
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
|
|
||||||
## END: BODY ##
|
|
||||||
|
|
||||||
# rss feed
|
# rss feed
|
||||||
feed:
|
feed:
|
||||||
#!/usr/bin/env sh
|
echo "<rss version=\"2.0\"><channel><title>gamelog</title>" > dist/feed.xml
|
||||||
feedtmpl='<item>
|
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
|
||||||
<title>{{{{Game_Module}} ({{{{Game_System}})</title>
|
recsel {{database}} | recfmt -f templates/feed.template >> dist/feed.xml
|
||||||
<link>http://tilde.town/~dozens/gamelog/index.html</link>
|
echo '</channel></rss>' >> dist/feed.xml
|
||||||
<pubDate>{{{{Created}}</pubDate>
|
|
||||||
<description>
|
|
||||||
<![CDATA[
|
|
||||||
{{{{Text}}
|
|
||||||
]]>
|
|
||||||
</description>
|
|
||||||
</item>
|
|
||||||
'
|
|
||||||
exec > dist/feed.xml
|
|
||||||
cat<<EOF
|
|
||||||
<?xml version="1.0" ?>
|
|
||||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
|
||||||
<channel>
|
|
||||||
<atom:link rel="self" type="application/rss+xml" href="http://tilde.town/~dozens/gamelog/feed.xml"/>
|
|
||||||
<title>gamelog</title>
|
|
||||||
<link>http://tilde.town/~dozens/gamelog/index.html</link>
|
|
||||||
<description>all the games i play</description>
|
|
||||||
EOF
|
|
||||||
recsel -t Update -j Game {{database}} | recfmt "$feedtmpl"
|
|
||||||
echo '</channel></rss>'
|
|
||||||
sed -i '' 's/&/and/g' dist/feed.xml
|
sed -i '' 's/&/and/g' dist/feed.xml
|
||||||
|
|
||||||
# copy to blog
|
# copy to blog
|
||||||
|
@ -127,4 +61,3 @@ up: build export
|
||||||
|
|
||||||
# do everything
|
# do everything
|
||||||
all: build up
|
all: build up
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
# Templates
|
||||||
|
|
||||||
|
this directory holds templates, includes, partials, etc.
|
||||||
|
|
||||||
|
Namely `.template` files for recfmt, and `.html` files for pandoc
|
|
@ -0,0 +1,4 @@
|
||||||
|
<hr />
|
||||||
|
<p>
|
||||||
|
<center>✌️</center>
|
||||||
|
</p>
|
|
@ -0,0 +1,10 @@
|
||||||
|
<p>In 2021 I started keeping track of all the <abbr title="tabletop role playing game">ttrpgs</abbr> I play in a recfile database.</p>
|
||||||
|
|
||||||
|
<p>Learn more at <a href="https://git.tilde.town/dozens/gamelog">https://git.tilde.town/dozens/gamelog</a></p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
This site is part of the dozensweb webring:
|
||||||
|
<a href="https://tilde.town/%7Edozens/webring/dozens/index.html?name=gamelog&dir=prev">previous</a>
|
||||||
|
<a href="https://tilde.town/%7Edozens/webring/dozens/index.html">index</a>
|
||||||
|
<a href="https://tilde.town/%7Edozens/webring/dozens/index.html?name=gamelog&dir=next">next</a>
|
||||||
|
</p>
|
|
@ -0,0 +1,10 @@
|
||||||
|
<item>
|
||||||
|
<title>{{System}} - {{Module}}</title>
|
||||||
|
<link>http://tilde.town/~dozens/gamelog/index.html</link>
|
||||||
|
<pubDate>{{Updated}}</pubDate>
|
||||||
|
<description>
|
||||||
|
<![CDATA[
|
||||||
|
{{Notes}}
|
||||||
|
]]>
|
||||||
|
</description>
|
||||||
|
</item>
|
|
@ -0,0 +1,12 @@
|
||||||
|
<link rel="alternate" type="application/rss+xml" href="/feed.xml" title="dozens gamelog">
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
max-width: 68ch;
|
||||||
|
margin: 0 auto;
|
||||||
|
line-height: 1.2;
|
||||||
|
}
|
||||||
|
h2 {
|
||||||
|
border-bottom: solid 1px black;
|
||||||
|
margin-top: 3rem;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -0,0 +1,9 @@
|
||||||
|
## {{Module}} ({{System}})
|
||||||
|
|
||||||
|
{{Module}} is a game of {{System}} that I started playing {{Started}} as a {{Role}}. It is a {{Format}} {{Length}} and is currently {{Status}}.
|
||||||
|
|
||||||
|
Here's how it went!
|
||||||
|
|
||||||
|
{{Notes}}
|
||||||
|
|
||||||
|
<p><center>🎲🎲</center></p>
|
|
@ -0,0 +1,6 @@
|
||||||
|
function Meta(m)
|
||||||
|
if m.date == nil then
|
||||||
|
m.date = os.date("%B %e, %Y")
|
||||||
|
return m
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue