Bauke/cv
Bauke
/
cv
1
Fork 0

Replace compilation with a temporary script.

This commit is contained in:
Bauke 2024-01-16 18:17:53 +01:00
parent 4ec59a1414
commit d27b64bd40
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
3 changed files with 23 additions and 7 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
.vscode/
build/
data/
cv.typ

View File

@ -23,12 +23,7 @@ args = ["trash", "build"]
[tasks.compile]
clear = true
dependencies = ["ensure-build-dir"]
command = "typst"
args = [
"compile",
"cv-${CV_LANG}.typ",
"build/CV-Bauke-${CV_LANG}.pdf"
]
script = "./compile-cv.zsh"
# Ensure that the build directory exists.
[tasks.ensure-build-dir]
@ -41,4 +36,4 @@ args = ["-p", "build"]
[tasks.watch]
clear = true
command = "watchexec"
args = ["-e", "toml,typ", "--no-vcs-ignore", "makers build"]
args = ["-e", "toml,typ", "-i", "cv.typ", "--no-vcs-ignore", "makers build"]

20
compile-cv.zsh Executable file
View File

@ -0,0 +1,20 @@
#!/usr/bin/env zsh
# There's currently no way in Typst to provide values from the CLI in some way
# so until the next version lands and https://github.com/typst/typst/pull/2894
# becomes available, a script that renders a template has to be it for now.
# Define options based on environment variables or use default values.
include_links=${CV_INCLUDE_LINKS:-"true"}
language=${CV_LANG:-"en"}
typst_template="#import \"main.typ\": cv
#cv(
include_links: $include_links,
language: \"$language\",
)"
echo $typst_template > cv.typ
typst compile cv.typ "build/CV-Bauke-$CV_LANG.pdf"