Last active
December 25, 2023 07:29
-
-
Save derektamsen/c0cd95efc2132b93b4af348c8cbd04e3 to your computer and use it in GitHub Desktop.
Makefile to render all mermaid diagrams in the directory it is placed in.
This file contains 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
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 |
This file contains 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
{ | |
"theme": "default" | |
} |
@Enough7 You are welcome! Thanks of the modification. I have also updated the gist with your suggestions.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey,
thanks for sharing your work.
I modified it a little bit, so that the build is only run when the origin-diagram changed and clean only deletes the images in output not the whole folder.
mermaidconfig.json
: