Skip to content
Snippets Groups Projects
Commit 81e540f8 authored by James Vasile's avatar James Vasile
Browse files

Add a watch command

parent 25b4dcdd
No related branches found
No related tags found
No related merge requests found
# Typst Makefile # Typst Makefile
OTS_TYPST_COMMAND?=compile
default: all default: all
all: prereq all: prereq
...@@ -26,10 +29,10 @@ all-drafts: prereq ...@@ -26,10 +29,10 @@ all-drafts: prereq
@for name in *.typ; do $(MAKE) `basename $${name} .typ`.draft.pdf; done @for name in *.typ; do $(MAKE) `basename $${name} .typ`.draft.pdf; done
%.draft.pdf: %.typ prereq %.draft.pdf: %.typ prereq
typst compile --input draft=draft $< $@ typst ${OTS_TYPST_COMMAND} --input draft=draft $< $@
%.pdf: %.typ prereq %.pdf: %.typ prereq
typst compile $< typst ${OTS_TYPST_COMMAND} $<
# We don't remove .pdf files by default, even though they're generated # We don't remove .pdf files by default, even though they're generated
# files, because in practice one usually wants to keep them around. # files, because in practice one usually wants to keep them around.
......
...@@ -47,6 +47,11 @@ build(){ ...@@ -47,6 +47,11 @@ build(){
fi fi
} }
watch() {
export OTS_TYPST_COMMAND=watch
build "$@"
}
clean() { clean() {
rm -f *.draft.pdf typst rm -f *.draft.pdf typst
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment