mirror of
https://github.com/sdiehl/write-you-a-haskell.git
synced 2024-11-05 02:33:57 +03:00
3b0358ebec
* New trigger `pdf`: Builds all chapters into a single pdf.
27 lines
758 B
Makefile
27 lines
758 B
Makefile
PANDOC = pandoc
|
|
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
|
|
|
|
%.html: %.md $(FILTER)
|
|
$(PANDOC) -c $(STYLE) --filter ${FILTER} --template $(TEMPLATE) -s -f $(IFORMAT) -t html $(FLAGS) -o $@ $<
|
|
|
|
%.pdf: %.md $(FILTER)
|
|
$(PANDOC) --filter ${FILTER} -f $(IFORMAT) --latex-engine=xelatex $(FLAGS) -o $@ $<
|
|
|
|
pdf: $(FILTER)
|
|
$(PANDOC) --filter ${FILTER} -f $(IFORMAT) --latex-engine=xelatex $(FLAGS) -o WYAH.pdf 0*.md
|
|
|
|
top: $(FILTER)
|
|
$(PANDOC) -c $(STYLE) --filter ${FILTER} --template $(TEMPLATE) -s -f $(IFORMAT) -t html $(FLAGS) -o tutorial.html index.md
|
|
|
|
clean:
|
|
-rm *.html *.pdf
|