resume.toml/justfile

91 lines
1.6 KiB
Plaintext
Raw Permalink Normal View History

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
2023-12-06 05:51:32 +00:00
# format toml
fmt:
taplo fmt {{toml}}
2023-12-06 05:51:32 +00:00
# validate toml
validate:
taplo lint {{toml}}
2023-12-06 05:51:32 +00:00
# create view
_view:
#!/usr/bin/env sh
for f in "lib/lambdas.js" "{{toml}}"
do
if [ "$f" -nt lib/view.js ]
then
ed<<EOF
i
module.exports =
.
r !taplo get -f {{toml}} -o json
-1s/$/,
.r lib/lambdas.js
w lib/view.js
q
EOF
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