-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (42 loc) · 2.27 KB
/
Copy pathMakefile
File metadata and controls
58 lines (42 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
PANDOC ?= pandoc
PYTHON ?= python3
DIST ?= dist
NO_INPUTS = $(shell $(PYTHON) tools/book_inputs.py no)
EN_INPUTS = $(shell $(PYTHON) tools/book_inputs.py en)
.PHONY: check examples web epub kindle pdf books clean
check: examples
$(PYTHON) tools/check_content.py
$(PYTHON) tools/check_accessibility.py
$(PYTHON) tools/check_links.py
$(PYTHON) tools/book_inputs.py no >/dev/null
$(PYTHON) tools/book_inputs.py en >/dev/null
examples:
$(PYTHON) tools/check_examples.py
web: $(DIST)/web/no/index.html $(DIST)/web/en/index.html
$(DIST)/web/no/index.html: $(NO_INPUTS) book/no.yaml web/template.html web/style.css
mkdir -p $(DIST)/web/no $(DIST)/web/en
cp web/style.css $(DIST)/web/style.css
$(PANDOC) --metadata-file=book/no.yaml --template=web/template.html --standalone -o $@ $(NO_INPUTS)
$(DIST)/web/en/index.html: $(EN_INPUTS) book/en.yaml web/template.html web/style.css
mkdir -p $(DIST)/web/no $(DIST)/web/en
cp web/style.css $(DIST)/web/style.css
$(PANDOC) --metadata-file=book/en.yaml --template=web/template.html --standalone -o $@ $(EN_INPUTS)
epub: $(DIST)/EduPython-Senior-NO.epub $(DIST)/EduPython-Senior-EN.epub
$(DIST)/EduPython-Senior-NO.epub: $(NO_INPUTS) book/no.yaml book/epub.css
mkdir -p $(DIST)
$(PANDOC) --metadata-file=book/no.yaml --css=book/epub.css --toc -o $@ $(NO_INPUTS)
$(DIST)/EduPython-Senior-EN.epub: $(EN_INPUTS) book/en.yaml book/epub.css
mkdir -p $(DIST)
$(PANDOC) --metadata-file=book/en.yaml --css=book/epub.css --toc -o $@ $(EN_INPUTS)
kindle: epub
$(PYTHON) tools/check_kindle.py $(DIST)/EduPython-Senior-NO.epub $(DIST)/EduPython-Senior-EN.epub
pdf: $(DIST)/EduPython-Senior-NO.pdf $(DIST)/EduPython-Senior-EN.pdf
$(DIST)/EduPython-Senior-NO.pdf: $(NO_INPUTS) book/no.yaml
mkdir -p $(DIST)
$(PANDOC) --metadata-file=book/no.yaml --toc --pdf-engine=xelatex -V papersize:a4 -V geometry:margin=25mm -V fontsize=12pt -V linestretch=1.15 -V mainfont="DejaVu Serif" -V monofont="DejaVu Sans Mono" -o $@ $(NO_INPUTS)
$(DIST)/EduPython-Senior-EN.pdf: $(EN_INPUTS) book/en.yaml
mkdir -p $(DIST)
$(PANDOC) --metadata-file=book/en.yaml --toc --pdf-engine=xelatex -V papersize:a4 -V geometry:margin=25mm -V fontsize=12pt -V linestretch=1.15 -V mainfont="DejaVu Serif" -V monofont="DejaVu Sans Mono" -o $@ $(EN_INPUTS)
books: epub kindle pdf
clean:
rm -rf $(DIST)