Skip to content
Newer
Older
100644 152 lines (128 sloc) 3.49 KB
b0499ab @Marak First commit of new skeleton. Structure almost complete, still need t…
Marak authored
1 # Makefile originally from the 'Mastering Node' book written TJ Holowaychuk
2 # https://github.com/visionmedia/masteringnode
3 #
4
3c76a70 @jfhbrook [ux] Generate books using pandoc
jfhbrook authored
5 # used with pdf generator tool. TODO: Replace with pandoc.
e87d3c6 @Marak update
Marak authored
6 PDF_FLAGS = --fontsize 9.0 \
de95528 @AvianFlu [fix] Moved API instructions
AvianFlu authored
7 --linkstyle plain \
8 --linkcolor blue \
9 --embedfonts \
10 --footer "c 1" \
11 --no-toc
e87d3c6 @Marak update
Marak authored
12
3c76a70 @jfhbrook [ux] Generate books using pandoc
jfhbrook authored
13 # Pages that make up the full text (in markdown)
f57ae54 @jfhbrook Separated title page and introduction
jfhbrook authored
14 MD = pages/title.md \
3c76a70 @jfhbrook [ux] Generate books using pandoc
jfhbrook authored
15 chapters/toc.md \
16 chapters/introduction.md \
17 chapters/hello_world.md \
18 chapters/platform_features.md \
19 chapters/jitsu.md \
20 chapters/web_admin.md \
21 chapters/json_api.md \
22 chapters/haibu.md \
23 chapters/open_source_projects.md \
24 chapters/faq.md \
25 chapters/support.md \
26 appendices/toc.md \
27 appendices/package.json.md \
28 appendices/resources.md \
29 appendices/building_the_handbook.md
30
31 # An abridged version of the handbook
32 README = pages/title.md \
33 chapters/toc.readme.md \
34 chapters/introduction.md \
35 chapters/hello_world.md \
36 chapters/platform_features.md \
37 chapters/jitsu.md \
38 chapters/web_admin.md \
39 chapters/json_api.md \
40 chapters/haibu.md \
41 chapters/open_source_projects.md \
42 chapters/faq.md \
43 chapters/support.md
44
45 # Just the API docs
a201c42 @jfhbrook [refactor] Makefile only pulls the introduction for the ReadMe, for n…
jfhbrook authored
46 API = chapters/json_api.md
e87d3c6 @Marak update
Marak authored
47
3c76a70 @jfhbrook [ux] Generate books using pandoc
jfhbrook authored
48 # HTML files (generated by ronn)
e87d3c6 @Marak update
Marak authored
49 HTML = $(MD:.md=.html)
50
3c76a70 @jfhbrook [ux] Generate books using pandoc
jfhbrook authored
51 # We use make with sed to implement microtemplating so that we may
52 # use multiple folders/sources for images as needed.
53 # SEE: book.md ReadMe.md API.md %.html
54 GITHUB_FIG = https://raw.github.com/nodejitsu/handbook/master/fig
55 LOCAL_FIG = fig
e87d3c6 @Marak update
Marak authored
56
3c76a70 @jfhbrook [ux] Generate books using pandoc
jfhbrook authored
57 all: book.html book.pdf book.md ReadMe.md API.md website clear
3c440b3 @jfhbrook [dist] Regenerated handbook
jfhbrook authored
58
3c76a70 @jfhbrook [ux] Generate books using pandoc
jfhbrook authored
59 book.md:
e87d3c6 @Marak update
Marak authored
60 @echo "\n... generating $@"
3c76a70 @jfhbrook [ux] Generate books using pandoc
jfhbrook authored
61 cat $(MD) \
62 | sed "s {{fig}} $(GITHUB_FIG) " \
63 > book.md
e87d3c6 @Marak update
Marak authored
64
3c76a70 @jfhbrook [ux] Generate books using pandoc
jfhbrook authored
65 ReadMe.md:
a49157e @Marak Added book.md to Makefile
Marak authored
66 @echo "\n... generating $@"
3c76a70 @jfhbrook [ux] Generate books using pandoc
jfhbrook authored
67 cat $(README) \
68 | sed "s {{fig}} $(GITHUB_FIG) " \
69 > ReadMe.md
de95528 @AvianFlu [fix] Moved API instructions
AvianFlu authored
70
3c76a70 @jfhbrook [ux] Generate books using pandoc
jfhbrook authored
71 API.md:
00a10ec @Marak messing with ReadMe.md
Marak authored
72 @echo "\n... generating $@"
3c76a70 @jfhbrook [ux] Generate books using pandoc
jfhbrook authored
73 cat $(API) \
74 | sed "s {{fig}} $(GITHUB_FIG) " \
75 > API.md
de95528 @AvianFlu [fix] Moved API instructions
AvianFlu authored
76
3c76a70 @jfhbrook [ux] Generate books using pandoc
jfhbrook authored
77 book.html: pages/head.html pages/tail.html book.md
de95528 @AvianFlu [fix] Moved API instructions
AvianFlu authored
78 @echo "\n... generating $@"
3c76a70 @jfhbrook [ux] Generate books using pandoc
jfhbrook authored
79 echo `cat pages/head.html` \
80 `cat pandoc -t html book.md` \
81 `cat pages/tail.html` \
82 > book.html
a49157e @Marak Added book.md to Makefile
Marak authored
83
3c76a70 @jfhbrook [ux] Generate books using pandoc
jfhbrook authored
84 # TODO: Use pandoc and latex instead of htmldoc
85 book.pdf:
e87d3c6 @Marak update
Marak authored
86 @echo "\n... generating $@"
3c76a70 @jfhbrook [ux] Generate books using pandoc
jfhbrook authored
87 cat $(MD) \
88 | sed "s {{fig}} $(LOCAL_FIG) " \
89 | pandoc -f markdown -o book.pdf
e87d3c6 @Marak update
Marak authored
90
3c76a70 @jfhbrook [ux] Generate books using pandoc
jfhbrook authored
91 # .mobi version
e87d3c6 @Marak update
Marak authored
92 book.mobi:
93 @echo "\n... generating $@"
94 ebook-convert book.html book.mobi --output-profile kindle
95
3c76a70 @jfhbrook [ux] Generate books using pandoc
jfhbrook authored
96 # .epub version
e87d3c6 @Marak update
Marak authored
97 book.epub:
98 @echo "\n... generating $@"
99 ebook-convert book.html book.epub \
b0499ab @Marak First commit of new skeleton. Structure almost complete, still need t…
Marak authored
100 --title "Nodejitsu Handbook" \
e87d3c6 @Marak update
Marak authored
101 --no-default-epub-cover \
6cf3789 @jfhbrook [minor] Added "Joshua Holbrook" to epub authors
jfhbrook authored
102 --authors "Marak Squires, Joshua Holbrook" \
e87d3c6 @Marak update
Marak authored
103 --language en \
104 --cover pages/cover.jpg
105
3c76a70 @jfhbrook [ux] Generate books using pandoc
jfhbrook authored
106 # Assemble our "website" bundle (move things into public folder, etc.)
107 website: book.html public
108 @echo "\n... copying items into ./public"
109 cp book.html public/index.html
110 cp book.pdf public/book.pdf
111 cp -r fig public/fig
112
113 public:
114 mkdir public
115
116 # Regenerate handbook, commit
117 regenerate: clean all
118 git commit -a -m '[dist] Regenerated handbook'
119
120 # Push code changes to github and nodejitsu
121 publish: regenerate
122 git push origin master
123 if [ "nodejitsu" != $(jitsu whoami) ]; then
124 jitsu login --username nodejitsu
125 fi
126 jitsu deploy
e87d3c6 @Marak update
Marak authored
127
128 clean:
129 rm -f book.*
130 rm -f chapters/*.html
0871ca3 @jfhbrook [minor] I guess tabs are treated differently than spaces in makefiles…
jfhbrook authored
131 rm -f appendices/*.html
3bd5b8f @jfhbrook [dist] Regenerated handbook
jfhbrook authored
132 rm -f pages/index.html
133 rm -f pages/title.html
b321657 @jfhbrook [dist] Added "website" target to makefile
jfhbrook authored
134 rm -rf public
e87d3c6 @Marak update
Marak authored
135
1470fb2 @Marak Updates to docs, updates to makefile
Marak authored
136 clear:
137 rm -f chapters/*.html
0871ca3 @jfhbrook [minor] I guess tabs are treated differently than spaces in makefiles…
jfhbrook authored
138 rm -f appendices/*.html
9fcd972 @Marak updates
Marak authored
139 rm -f pages/index.html
3bd5b8f @jfhbrook [dist] Regenerated handbook
jfhbrook authored
140 rm -f pages/title.html
1470fb2 @Marak Updates to docs, updates to makefile
Marak authored
141
3c76a70 @jfhbrook [ux] Generate books using pandoc
jfhbrook authored
142 # TODO: Fall back to evince
143 view: book.pdf
144 open book.pdf || evince book.pdf
145
146 serve: website
147 @echo "\n... serving website!"
148 node ./bin/server
149
150 # TODO: Do I need this? Unsure.
f57ae54 @jfhbrook Separated title page and introduction
jfhbrook authored
151 .PHONY: view clean regenerate
Something went wrong with that request. Please try again.