From 3b0358ebec35573111c8d82f67ce112a2f74595f Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Thu, 8 Jan 2015 02:31:28 +0000 Subject: [PATCH] Rewrite Makefile * New trigger `pdf`: Builds all chapters into a single pdf. --- Makefile | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 3e19a57..83c5f84 100644 --- a/Makefile +++ b/Makefile @@ -3,23 +3,24 @@ IFORMAT = markdown FLAGS = --standalone --toc --toc-depth=2 --mathjax --highlight-style pygments TEMPLATE = page.tmpl STYLE = css/style.css +FILTER = includes.hs SRC = $(wildcard *.md) OBJ = $(SRC:.md=.html) all: $(OBJ) top -includes: includes.hs - ghc --make $< +%.html: %.md $(FILTER) + $(PANDOC) -c $(STYLE) --filter ${FILTER} --template $(TEMPLATE) -s -f $(IFORMAT) -t html $(FLAGS) -o $@ $< -%.html: %.md includes - ./includes < $< | $(PANDOC) -c $(STYLE) --template $(TEMPLATE) -s -f $(IFORMAT) -t html $(FLAGS) -o $@ +%.pdf: %.md $(FILTER) + $(PANDOC) --filter ${FILTER} -f $(IFORMAT) --latex-engine=xelatex $(FLAGS) -o $@ $< -%.pdf: %.md includes - ./includes < $< | $(PANDOC) -c -s -f $(IFORMAT) --latex-engine=xelatex $(FLAGS) -o $@ +pdf: $(FILTER) + $(PANDOC) --filter ${FILTER} -f $(IFORMAT) --latex-engine=xelatex $(FLAGS) -o WYAH.pdf 0*.md -top: - ./includes < index.md | $(PANDOC) -c $(STYLE) --template $(TEMPLATE) -s -f $(IFORMAT) -t html $(FLAGS) -o tutorial.html +top: $(FILTER) + $(PANDOC) -c $(STYLE) --filter ${FILTER} --template $(TEMPLATE) -s -f $(IFORMAT) -t html $(FLAGS) -o tutorial.html index.md clean: - -rm pages/*.html + -rm *.html *.pdf