summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files 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 <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)