mirror of
https://github.com/sdiehl/write-you-a-haskell.git
synced 2024-11-05 02:33:57 +03:00
Rewrite Makefile
* New trigger `pdf`: Builds all chapters into a single pdf.
This commit is contained in:
parent
7150d1169d
commit
3b0358ebec
19
Makefile
19
Makefile
@ -3,23 +3,24 @@ IFORMAT = markdown
|
|||||||
FLAGS = --standalone --toc --toc-depth=2 --mathjax --highlight-style pygments
|
FLAGS = --standalone --toc --toc-depth=2 --mathjax --highlight-style pygments
|
||||||
TEMPLATE = page.tmpl
|
TEMPLATE = page.tmpl
|
||||||
STYLE = css/style.css
|
STYLE = css/style.css
|
||||||
|
FILTER = includes.hs
|
||||||
|
|
||||||
SRC = $(wildcard *.md)
|
SRC = $(wildcard *.md)
|
||||||
OBJ = $(SRC:.md=.html)
|
OBJ = $(SRC:.md=.html)
|
||||||
|
|
||||||
all: $(OBJ) top
|
all: $(OBJ) top
|
||||||
|
|
||||||
includes: includes.hs
|
%.html: %.md $(FILTER)
|
||||||
ghc --make $<
|
$(PANDOC) -c $(STYLE) --filter ${FILTER} --template $(TEMPLATE) -s -f $(IFORMAT) -t html $(FLAGS) -o $@ $<
|
||||||
|
|
||||||
%.html: %.md includes
|
%.pdf: %.md $(FILTER)
|
||||||
./includes < $< | $(PANDOC) -c $(STYLE) --template $(TEMPLATE) -s -f $(IFORMAT) -t html $(FLAGS) -o $@
|
$(PANDOC) --filter ${FILTER} -f $(IFORMAT) --latex-engine=xelatex $(FLAGS) -o $@ $<
|
||||||
|
|
||||||
%.pdf: %.md includes
|
pdf: $(FILTER)
|
||||||
./includes < $< | $(PANDOC) -c -s -f $(IFORMAT) --latex-engine=xelatex $(FLAGS) -o $@
|
$(PANDOC) --filter ${FILTER} -f $(IFORMAT) --latex-engine=xelatex $(FLAGS) -o WYAH.pdf 0*.md
|
||||||
|
|
||||||
top:
|
top: $(FILTER)
|
||||||
./includes < index.md | $(PANDOC) -c $(STYLE) --template $(TEMPLATE) -s -f $(IFORMAT) -t html $(FLAGS) -o tutorial.html
|
$(PANDOC) -c $(STYLE) --filter ${FILTER} --template $(TEMPLATE) -s -f $(IFORMAT) -t html $(FLAGS) -o tutorial.html index.md
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-rm pages/*.html
|
-rm *.html *.pdf
|
||||||
|
Loading…
Reference in New Issue
Block a user