Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 55 lines (46 sloc) 1.455 kb
bc3c839 @andreas-marschke add Makefile with support for pdf,epub and html
andreas-marschke authored
1 include_dir=build
6fa8786 @wibblymat Split the source markdown into chapters (to start #194)
wibblymat authored
2 source=chapters/*.md
0614b46 @sindresorhus Rewrite Makefile
sindresorhus authored
3 title='Developing Backbone.js Applications'
4 filename='backbone-fundamentals'
5
6
7 all: html epub rtf pdf mobi
bc3c839 @andreas-marschke add Makefile with support for pdf,epub and html
andreas-marschke authored
8
34c31ac @wibblymat By creating a concatenated Markdown version first, we can build all of t...
wibblymat authored
9 markdown:
10 awk 'FNR==1{print ""}{print}' $(source) > $(filename).md
11
12 html: markdown
13 pandoc -s $(filename).md -t html5 -o index.html -c style.css \
0614b46 @sindresorhus Rewrite Makefile
sindresorhus authored
14 --include-in-header $(include_dir)/head.html \
15 --include-before-body $(include_dir)/author.html \
16 --include-before-body $(include_dir)/share.html \
17 --include-after-body $(include_dir)/stats.html \
18 --title-prefix $(title) \
19 --normalize \
fa0a683 @sindresorhus Automatic TOC
sindresorhus authored
20 --smart \
21 --toc
bc3c839 @andreas-marschke add Makefile with support for pdf,epub and html
andreas-marschke authored
22
34c31ac @wibblymat By creating a concatenated Markdown version first, we can build all of t...
wibblymat authored
23 epub: markdown
24 pandoc -s $(filename).md --normalize --smart -t epub -o $(filename).epub \
0614b46 @sindresorhus Rewrite Makefile
sindresorhus authored
25 --epub-metadata $(include_dir)/metadata.xml \
26 --epub-stylesheet epub.css \
27 --epub-cover-image img/cover.jpg \
28 --title-prefix $(title) \
29 --normalize \
fa0a683 @sindresorhus Automatic TOC
sindresorhus authored
30 --smart \
31 --toc
bc3c839 @andreas-marschke add Makefile with support for pdf,epub and html
andreas-marschke authored
32
34c31ac @wibblymat By creating a concatenated Markdown version first, we can build all of t...
wibblymat authored
33 rtf: markdown
34 pandoc -s $(filename).md -o $(filename).rtf \
fa0a683 @sindresorhus Automatic TOC
sindresorhus authored
35 --title-prefix $(title) \
0614b46 @sindresorhus Rewrite Makefile
sindresorhus authored
36 --normalize \
37 --smart
bc3c839 @andreas-marschke add Makefile with support for pdf,epub and html
andreas-marschke authored
38
34c31ac @wibblymat By creating a concatenated Markdown version first, we can build all of t...
wibblymat authored
39 pdf: markdown
0614b46 @sindresorhus Rewrite Makefile
sindresorhus authored
40 # You need `pdflatex`
41 # OS X: http://www.tug.org/mactex/
42 # Then find its path: find /usr/ -name "pdflatex"
43 # Then symlink it: ln -s /path/to/pdflatex /usr/local/bin
34c31ac @wibblymat By creating a concatenated Markdown version first, we can build all of t...
wibblymat authored
44 pandoc -s $(filename).md -o $(filename).pdf \
0614b46 @sindresorhus Rewrite Makefile
sindresorhus authored
45 --title-prefix $(title) \
46 --normalize \
fa0a683 @sindresorhus Automatic TOC
sindresorhus authored
47 --smart \
cc3339d @lrcg Fixed: Issue #284
lrcg authored
48 --toc \
019b298 @addyosmani manually bring in #369 - xelatex instead of pdflatex
authored
49 --latex-engine=`which xelatex`
bc3c839 @andreas-marschke add Makefile with support for pdf,epub and html
andreas-marschke authored
50
0614b46 @sindresorhus Rewrite Makefile
sindresorhus authored
51 mobi: epub
52 # Download: http://www.amazon.com/gp/feature.html?ie=UTF8&docId=1000765211
53 # Symlink bin: ln -s /path/to/kindlegen /usr/local/bin
54 kindlegen $(filename).epub
Something went wrong with that request. Please try again.