forked from jimschubert/masteringnode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
71 lines (57 loc) · 1.64 KB
/
Makefile
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
59
60
61
62
63
64
65
66
67
68
69
70
71
PDF_FLAGS = --fontsize 8.0 \
--linkstyle plain \
--linkcolor green \
--embedfonts \
--footer "c 1" \
--format pdf12
MD = chapters/all.md
HTML = $(MD:.md=.html)
all: clean book.html book.pdf book.mobi book.epub
regenerate: all clean_html
@echo "\nRunning: $@"
git commit -a -m 'Regenerated book' && echo done
book.pdf: book.html
@echo "\nGenerating: $@"
htmldoc docs/book.html $(PDF_FLAGS) -f docs/$@
book.html: clean pages/head.html pages/tail.html $(HTML)
@echo "\nGenerating: $@"
cat pages/head.html $(HTML) pages/tail.html > docs/book.html
%.html: %.md
node tools/doctool/doctool.js pages/singletemplate.html $< > $@
book.mobi: book.html
@echo "\nGenerating: $@"
ebook-convert docs/book.html docs/book.mobi --output-profile kindle \
--dont-compress \
--mobi-ignore-margins \
--pretty-print \
--insert-blank-line \
--margin-left 50 \
--margin-right 50 \
--margin-top 50 \
--margin-bottom 50 \
--title "Mastering Node" \
--authors "TJ Holowaychuk, Jim Schubert" \
--tags "Mastering Node, JavaScript, node.js" \
--language en \
--cover pages/cover.jpg \
--disable-fix-indents \
--disable-font-rescaling
book.epub: book.html
@echo "\nGenerating: $@"
ebook-convert docs/book.html docs/book.epub \
--title "Mastering Node" \
--no-default-epub-cover \
--authors "TJ Holowaychuk, Jim Schubert" \
--tags "Mastering Node, JavaScript, node.js" \
--language en \
--cover pages/cover.jpg
view: book.pdf
open docs/book.pdf
clean: clean_books clean_html
clean_books:
@echo "\nRemoving book files..."
rm -f docs/book.*
clean_html:
@echo "\nRemoving html files..."
rm -f chapters/*.html
.PHONY: view clean regenerate