1
0
Fork 0

Add build script for cover letters

main
Ainsley Ellis 2025-06-01 23:05:38 -04:00
parent 80754fd617
commit f67f0ed36b
2 changed files with 11 additions and 0 deletions

11
scripts/letter.sh Normal file
View File

@ -0,0 +1,11 @@
#!/bin/sh
hash="$(git rev-parse HEAD)"
body="<text>$(pandoc --from=markdown $1)</text>"
company="$2" || ""
date="$(date +'%d %B %Y')"
signature="$(base64 ./assets/signature.svg)"
mkdir -p ../dist
echo $body | xsltproc --stringparam company "$company" --stringparam date "$date" --stringparam signature "$signature" ./templates/letter.xsl - > ./dist/letter.html
weasyprint --quiet ./dist/letter.html ./dist/letter.pdf