2024-02-05 23:25:02 +00:00
|
|
|
toml:="src/example.toml"
|
|
|
|
tmpl:="template/pdf.tmpl"
|
|
|
|
outpdf:="dist/example.pdf"
|
|
|
|
outhtm:="dist/example.html"
|
|
|
|
outtxt:="dist/example.txt"
|
|
|
|
|
|
|
|
|
2023-12-06 05:51:32 +00:00
|
|
|
# show all recipes
|
|
|
|
default:
|
|
|
|
just --list --unsorted
|
|
|
|
|
2024-02-05 23:25:02 +00:00
|
|
|
|
2023-12-06 05:51:32 +00:00
|
|
|
# format toml
|
|
|
|
fmt:
|
2024-02-05 23:25:02 +00:00
|
|
|
taplo fmt {{toml}}
|
|
|
|
|
2023-12-06 05:51:32 +00:00
|
|
|
|
|
|
|
# validate toml
|
|
|
|
validate:
|
2024-02-05 23:25:02 +00:00
|
|
|
taplo lint {{toml}}
|
2023-12-06 05:51:32 +00:00
|
|
|
|
2024-02-05 23:25:02 +00:00
|
|
|
|
|
|
|
# create view
|
|
|
|
_view:
|
2023-12-21 22:23:57 +00:00
|
|
|
#!/usr/bin/env sh
|
2024-02-05 23:25:02 +00:00
|
|
|
for f in "lib/lambdas.js" "{{toml}}"
|
|
|
|
do
|
|
|
|
if [ "$f" -nt lib/view.js ]
|
|
|
|
then
|
2023-12-21 22:23:57 +00:00
|
|
|
ed<<EOF
|
|
|
|
i
|
|
|
|
module.exports =
|
|
|
|
.
|
2024-02-05 23:25:02 +00:00
|
|
|
r !taplo get -f {{toml}} -o json
|
2023-12-21 22:23:57 +00:00
|
|
|
-1s/$/,
|
2024-02-05 23:25:02 +00:00
|
|
|
.r lib/lambdas.js
|
|
|
|
w lib/view.js
|
2023-12-21 22:23:57 +00:00
|
|
|
q
|
|
|
|
EOF
|
2024-02-05 23:25:02 +00:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
# create pdf
|
|
|
|
@pdf: _view
|
|
|
|
-[ lib/view.js -nt {{outpdf}} ] \
|
|
|
|
&& echo "Creating PDF" \
|
|
|
|
&& mustache lib/view.js {{tmpl}} \
|
|
|
|
| groff -ms -t -Tpdf > {{outpdf}} \
|
|
|
|
|| echo "No update"
|
|
|
|
|
|
|
|
# start a watcher
|
|
|
|
watch:
|
|
|
|
ls {{toml}} {{tmpl}} | entr -c just pdf
|
|
|
|
|
|
|
|
|
|
|
|
# create text
|
|
|
|
@text: _view
|
|
|
|
-[ lib/view.js -nt {{outtxt}} ] \
|
|
|
|
&& echo "Creating txt" \
|
|
|
|
&& mustache lib/view.js {{tmpl}} \
|
|
|
|
| nroff -ms -t \
|
|
|
|
| iconv -c -f utf-8 -t ascii \
|
|
|
|
> {{outtxt}} \
|
|
|
|
|| echo "No update"
|
|
|
|
|
|
|
|
|
|
|
|
# create html
|
|
|
|
@html: _view
|
|
|
|
-[ lib/view.js -nt {{outhtm}} ] \
|
|
|
|
&& echo "Creating html" \
|
|
|
|
&& mustache lib/view.js template/html.tmpl \
|
|
|
|
> {{outhtm}} \
|
|
|
|
|| echo "No update"
|
2024-02-28 00:44:25 +00:00
|
|
|
|
|
|
|
# view stale applications
|
|
|
|
@stale:
|
|
|
|
stale=$(gdate -d'- 14 days') \
|
|
|
|
&& recsel db/jobsearch.rec -ie 'status ~ "active"' -p company,created,updated \
|
|
|
|
| recsel -e "updated << '$stale'"
|
|
|
|
|
|
|
|
# make coverletter
|
|
|
|
coverletter:
|
|
|
|
#!/usr/bin/env sh
|
|
|
|
read -p "company: " company
|
|
|
|
read -p "position: " position
|
|
|
|
cat<<EOF | recfmt -f src/coverletter.ms | groff -ms -Tpdf > dist/coverletter.pdf
|
|
|
|
company: $company
|
|
|
|
position: $position
|
|
|
|
EOF
|