diff options
author | Jonas Smedegaard <dr@jones.dk> | 2015-10-16 12:16:23 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2015-10-16 12:16:23 +0200 |
commit | 36a4cac675ad6315f834f1c9e945901d1aa58242 (patch) | |
tree | cf4f9ed8357dc1faedcb5098647455030241a94a | |
parent | cb62cfeb403a60a1fd125c19dd680bb0f0b93a8a (diff) |
Include snippets, built as <div>-wrapped intermediaries.
-rw-r--r-- | Makefile | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -1,4 +1,5 @@ markdown-snippets := topbar.mdwn footer.mdwn +hypertext-snippets = $(markdown-snippets:%.mdwn=%.html) markdown := $(filter-out $(markdown-snippets),$(wildcard *.mdwn)) hypertext = $(subst index/index,index,$(markdown:%.mdwn=%/index.html)) @@ -8,9 +9,13 @@ update: source all source: .git git pull -%.html %/index.html: %.mdwn Makefile +$(hypertext-snippets): %.html: %.mdwn Makefile + pandoc -f markdown -t html -o $@ $< + sed -i -e '1i <div class=\"$*\">' -e '$$ a </div>' $@ + +%.html %/index.html: %.mdwn $(hypertext-snippets) Makefile $(if $(filter-out ./,$(dir $@)),mkdir -p $(dir $@)) - pandoc -s -f markdown -t html -o $@ $< + pandoc -s -B topbar.html -A footer.html -f markdown -t html -o $@ $< clean: find -type f -name '*.html' -delete @@ -19,3 +24,4 @@ clean: MAKEFLAGS += --jobs .NOTPARALLEL: source .PHONY: all update source clean +.INTERMEDIATE: $(hypertext-snippets) |