Compare commits
No commits in common. "a759853f087e4fec852b03eaef67e81b78f540c3" and "88a5f74dfbd389e1725265834fe508350cb59561" have entirely different histories.
a759853f08
...
88a5f74dfb
|
@ -2,3 +2,4 @@
|
||||||
.vscode/
|
.vscode/
|
||||||
build/
|
build/
|
||||||
data/
|
data/
|
||||||
|
cv.typ
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
[env]
|
|
||||||
CV_INCLUDE_LINKS = { condition = { env_not_set = ["CV_INCLUDE_LINKS"] }, value = "true" }
|
|
||||||
CV_VERSION = { condition = { env_not_set = ["CV_VERSION"] }, value = "2024-03-01" }
|
|
||||||
|
|
||||||
# Shorthand to compile all the languages at once.
|
# Shorthand to compile all the languages at once.
|
||||||
[tasks.build]
|
[tasks.build]
|
||||||
clear = true
|
clear = true
|
||||||
|
@ -9,12 +5,12 @@ dependencies = ["build-en", "build-nl"]
|
||||||
|
|
||||||
# Compile using the English locale.
|
# Compile using the English locale.
|
||||||
[tasks.build-en]
|
[tasks.build-en]
|
||||||
env = { CV_LANG = "en" }
|
env = { CV_LANG="en" }
|
||||||
extend = "compile"
|
extend = "compile"
|
||||||
|
|
||||||
# Compile using the Dutch locale.
|
# Compile using the Dutch locale.
|
||||||
[tasks.build-nl]
|
[tasks.build-nl]
|
||||||
env = { CV_LANG = "nl" }
|
env = { CV_LANG="nl" }
|
||||||
extend = "compile"
|
extend = "compile"
|
||||||
|
|
||||||
# Clean the repository by removing the build directory.
|
# Clean the repository by removing the build directory.
|
||||||
|
@ -27,14 +23,7 @@ args = ["trash", "build"]
|
||||||
[tasks.compile]
|
[tasks.compile]
|
||||||
clear = true
|
clear = true
|
||||||
dependencies = ["ensure-build-dir"]
|
dependencies = ["ensure-build-dir"]
|
||||||
command = "typst"
|
script = "./compile-cv.zsh"
|
||||||
args = [
|
|
||||||
"compile", "main.typ",
|
|
||||||
"--input", "language=${CV_LANG}",
|
|
||||||
"--input", "include_links=${CV_INCLUDE_LINKS}",
|
|
||||||
"--input", "version=${CV_VERSION}",
|
|
||||||
"build/CV-Bauke-${CV_LANG}.pdf",
|
|
||||||
]
|
|
||||||
|
|
||||||
# Ensure that the build directory exists.
|
# Ensure that the build directory exists.
|
||||||
[tasks.ensure-build-dir]
|
[tasks.ensure-build-dir]
|
||||||
|
@ -47,4 +36,4 @@ args = ["-p", "build"]
|
||||||
[tasks.watch]
|
[tasks.watch]
|
||||||
clear = true
|
clear = true
|
||||||
command = "watchexec"
|
command = "watchexec"
|
||||||
args = ["-e", "toml,typ", "--no-vcs-ignore", "makers build"]
|
args = ["-e", "toml,typ", "-i", "cv.typ", "--no-vcs-ignore", "makers build"]
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
#!/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"}
|
||||||
|
version="2024-03-01"
|
||||||
|
|
||||||
|
typst_template="#import \"main.typ\": cv
|
||||||
|
|
||||||
|
#cv(
|
||||||
|
include_links: $include_links,
|
||||||
|
language: \"$language\",
|
||||||
|
version: \"$version\",
|
||||||
|
)"
|
||||||
|
|
||||||
|
echo $typst_template > cv.typ
|
||||||
|
|
||||||
|
typst compile cv.typ "build/CV-Bauke-$CV_LANG.pdf"
|
12
flake.lock
12
flake.lock
|
@ -5,11 +5,11 @@
|
||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1710146030,
|
"lastModified": 1701680307,
|
||||||
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -20,11 +20,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1710827359,
|
"lastModified": 1703499205,
|
||||||
"narHash": "sha256-/KY8hffTh9SN/tTcDn/FrEiYwTXnU8NKnr4D7/stmmA=",
|
"narHash": "sha256-lF9rK5mSUfIZJgZxC3ge40tp1gmyyOXZ+lRY3P8bfbg=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "5710127d9693421e78cca4f74fac2db6d67162b1",
|
"rev": "e1fa12d4f6c6fe19ccb59cac54b5b3f25e160870",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
5
main.typ
5
main.typ
|
@ -5,10 +5,7 @@
|
||||||
#import "./utilities/content-to-string.typ": content_to_string
|
#import "./utilities/content-to-string.typ": content_to_string
|
||||||
#import "./utilities/localize.typ": localize
|
#import "./utilities/localize.typ": localize
|
||||||
|
|
||||||
#{
|
#let cv(include_links: true, language: "", version: "") = {
|
||||||
let (include_links, language, version) = sys.inputs
|
|
||||||
let include_links = include_links == "true"
|
|
||||||
|
|
||||||
if language == "" {
|
if language == "" {
|
||||||
panic("No language option specified.")
|
panic("No language option specified.")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue