summaryrefslogtreecommitdiffstats
path: root/invoice-gen
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2024-09-29 15:27:01 +0200
committerRomain Gonçalves <me@rgoncalves.se>2024-09-29 15:28:52 +0200
commit814f4e6a3e28c06bd60e53171748721ae365c2da (patch)
tree98825de0c053a986d755895b8a301ed26f414a7a /invoice-gen
downloadpaperwork-814f4e6a3e28c06bd60e53171748721ae365c2da.tar.gz
init: invoice-gen and examplestrunk
Diffstat (limited to 'invoice-gen')
-rwxr-xr-xinvoice-gen14
1 files changed, 14 insertions, 0 deletions
diff --git a/invoice-gen b/invoice-gen
new file mode 100755
index 0000000..b82050c
--- /dev/null
+++ b/invoice-gen
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -xe
+
+test -f "${1}"
+filename="$(echo "${1}" | rev | cut -d "." -f 2- | rev)"
+template="templates/template.gohtml"
+
+gomplate \
+ -c data="${1}" \
+ -c translations=templates/translations.yml \
+ -f "${template}" \
+ | tee "${filename}.html" \
+ | weasyprint - "${filename}.pdf"
remember that computers suck.