alias c := compile
alias w := watch

in_file := "main.typ"
out_file := "letter.pdf"

compile:
    mkdir -p ./out
    typst c {{in_file}} out/{{out_file}} --font-path $XDG_DATA_HOME/typst/packages/pandast/pl-docs/0.1.1/

watch: compile
    #!/usr/bin/env bash
    if command -v okular > /dev/null 2>&1
    then
        okular out/{{out_file}} &
    fi
    typst w {{in_file}} out/{{out_file}} --font-path $XDG_DATA_HOME/typst/packages/pandast/pl-docs/0.1.1/
