/
Makefile
89 lines (69 loc) · 1.92 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Makefile originally from the 'Mastering Node' book written TJ Holowaychuk
# https://github.com/visionmedia/masteringnode
#
PDF_FLAGS = --fontsize 9.0 \
--linkstyle plain \
--linkcolor blue \
--embedfonts \
--footer "c 1" \
--no-toc
MD = pages/title.md \
chapters/Table_Of_Contents.md \ #Hoping to autogenerate, yo
chapters/introduction.md \
chapters/hello_world.md \
chapters/open_source_projects.md \
chapters/troubleshooting_and_support.md \
chapters/appendices.md
README = pages/index.md \
chapters/Table_Of_Contents.md \
chapters/Introduction.md\
chapters/Deploying_Applications.md \
chapters/Using_The_Jitsu_Client.md \
chapters/Open_Source_Projects.md \
chapters/Additional_Information.md \
chapters/Databases.md
API = chapters/Using_The_API.md
HTML = $(MD:.md=.html)
all: book.html book.pdf book.md ReadMe.md API.md clear
regenerate: clean all
git commit -a -m 'Regenerated book' && echo done
book.pdf: $(HTML)
@echo "\n... generating $@"
htmldoc --webpage -f $@ $(PDF_FLAGS) $(HTML)
book.md: $(HTML)
@echo "\n... generating $@"
cat $(MD) > book.md
ReadMe.md: $(HTML)
@echo "\n... generating $@"
cat $(README) > ReadMe.md
API.md: $(HTML)
@echo "\n... generating $@"
cat $(API) > API.md
book.html: pages/head.html pages/tail.html $(HTML)
@echo "\n... generating $@"
@echo $(HTML)
cat pages/head.html $(HTML) pages/tail.html > book.html
%.html: %.md
ronn --pipe --fragment $< \
| sed -r 's/<h1>([^ ]+) - /<h1>/' \
> $@
book.mobi:
@echo "\n... generating $@"
ebook-convert book.html book.mobi --output-profile kindle
book.epub:
@echo "\n... generating $@"
ebook-convert book.html book.epub \
--title "Nodejitsu Handbook" \
--no-default-epub-cover \
--authors "Marak Squires" \
--language en \
--cover pages/cover.jpg
view: book.pdf
open book.pdf
clean:
rm -f book.*
rm -f chapters/*.html
clear:
rm -f chapters/*.html
rm -f pages/index.html
.PHONY: view clean regenerate