Skip to content

Instantly share code, notes, and snippets.

@Enough7
Forked from derektamsen/Makefile-mermaid
Last active December 22, 2023 17:37
Show Gist options
  • Save Enough7/9174f807e2021186340285e5f0b5a20b to your computer and use it in GitHub Desktop.
Save Enough7/9174f807e2021186340285e5f0b5a20b to your computer and use it in GitHub Desktop.
Makefile to render all mermaid diagrams in the directory it is placed in.
src_files := $(wildcard *.mmd)
out_files := $(patsubst %.mmd,output/%.png,$(src_files))
.PHONY: all clean
all: $(out_files)
output/%.png: %.mmd
mkdir -p $(dir $@)
mmdc -c ./mermaidconfig.json \
-i $< \
-o $@
clean:
rm output/*.png
{
"theme": "default"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment