Markdown Makefile Idiom

I can never remember this, and I use it frequently, so I thought I’d put it here where I can find it faster.

all: $(patsubst %.txt,%.html,$(wildcard *.txt))
%.html: %.txt header.html footer.html
    cat header.html > $@
    markdown $< >> $@
    cat footer.html >> $@

Leave a Reply