Last active
September 13, 2023 06:08
-
-
Save dcousens/8b3889a1cad98c14d51908ea89f0ff96 to your computer and use it in GitHub Desktop.
A generic D2 to SVG Makefile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# a generic D2 to SVG Makefile | |
.PHONY: clean watch | |
SRC = $(shell find . -name '*.d2') | |
SVGs = $(patsubst %.d2, %.svg, $(SRC)) | |
build: $(SVGs) | |
%.svg: %.d2 | |
d2 $< $@ | |
watch: | |
while inotifywait -e modify .; do | |
make build | |
done | |
clean: | |
rm -f $(SVGs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment