improve typed
command
This commit is contained in:
parent
cbf71bded5
commit
edafaf3c14
1 changed files with 7 additions and 2 deletions
|
@ -38,8 +38,13 @@ def glog [
|
||||||
def typed [
|
def typed [
|
||||||
name: string
|
name: string
|
||||||
] {
|
] {
|
||||||
touch $"($name).typ"
|
const DEFAULT_TYPST_FILE = "#import \"@local/typst-configs:0.1.0\": generic, sf;\n#show: generic.with();"
|
||||||
|
if not ($"($name).typ" | path exists) and not ($"($name).pdf" | path exists) {
|
||||||
|
$DEFAULT_TYPST_FILE | save $"($name).typ"
|
||||||
typst compile $"($name).typ"
|
typst compile $"($name).typ"
|
||||||
|
} else if ($"($name).pdf" | path exists) {
|
||||||
|
typst compile $"($name).typ"
|
||||||
|
}
|
||||||
mprocs --names Editor,Viewer,Notify $"hx '($name).typ'" $"while true; do mupdf-x11 '($name).pdf' && break; done" $"while inotifywait -e modify '($name).pdf' ; do pkill -HUP mupdf; done"
|
mprocs --names Editor,Viewer,Notify $"hx '($name).typ'" $"while true; do mupdf-x11 '($name).pdf' && break; done" $"while inotifywait -e modify '($name).pdf' ; do pkill -HUP mupdf; done"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue