From 36a4cac675ad6315f834f1c9e945901d1aa58242 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Fri, 16 Oct 2015 12:16:23 +0200 Subject: Include snippets, built as
-wrapped intermediaries. --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d4c5401..0d9346a 100644 --- a/Makefile +++ b/Makefile @@ -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
' -e '$$ a
' $@ + +%.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) -- cgit v1.2.3