summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2017-09-16 23:25:43 +0200
committerJonas Smedegaard <dr@jones.dk>2017-09-16 23:25:43 +0200
commit3cc08dd548bb418ea1bbeb74ba47fbedb02ceb38 (patch)
tree4e5cd50ded3d4b241789f3a7bb479cfce41e2ec6 /Makefile
parent8319d55f6302c82f7d19e2dc0d1b3623eacccadf (diff)
Use cmark.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 14 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index a55daf4..2ba1f46 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,25 @@
+htmlpages = index.html
+htmlheader = templates/header.html
+htmlfooter = templates/footer.html
cssfiles := css/main.css css/print.css
sass_includedir = /usr/share/compass/frameworks/toolkit/stylesheets
-all: $(cssfiles)
+all: $(htmlpages)
+
+$(htmlpages): %.html : %.md $(htmlheader) $(htmlfooter) $(cssfiles)
+ cat $(htmlheader) > $@
+ echo "<div id="book">" >> $@
+ echo "<div id="page1" class="page"><div class="inner">" >> $@
+ cmark $< >> $@
+ perl -p0i -e '$$i or $$i++; s!(<hr\s*/?>\s*){2}(?{$$i++})!</div></div>\n\n<div id="page$$i" class="page"><div class="inner">!g' $@
+ echo "</div></div>" >> $@
+ cat $(htmlfooter) >> $@
$(cssfiles): css/%.css : css/%.scss $(sass_includedir)
sassc -I $(sass_includedir) $< $@
clean:
- rm -f $(cssfiles)
+ rm -f $(cssfiles) $(htmlpages)
.PHONY: clean