Skip to content

Instantly share code, notes, and snippets.

@sideshowcoder
Last active June 15, 2018 13:22
Show Gist options
  • Save sideshowcoder/636db3538c8cc0062f352c964f028458 to your computer and use it in GitHub Desktop.
Save sideshowcoder/636db3538c8cc0062f352c964f028458 to your computer and use it in GitHub Desktop.
# Use Mermaid (https://github.com/knsv/mermaid) and Markdown to create word docs
# with diagrams.
# Requires Pandoc and mermaid pandoc filter to process all md files in the
# current folder to html and the html to docx for word
# see https://github.com/raghur/mermaid-filter
SRC = $(wildcard *.md)
DIA = $(SRC:.md=.html)
DOCS = $(DIA:.html=.docx)
.PHONY: default
default: docs
docs: $(DOCS)
diagrams: $(DIA)
clean:
-@rm -f *.html *.docx *.png 2>/dev/null || true
%.html: %.md
pandoc -t html -F mermaid-filter -o $@ $<
%.docx: %.html
pandoc -s $< -o $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment