-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
executable file
·49 lines (43 loc) · 1.27 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
include_dir=build
chapters_dir=chapters
source=$(chapters_dir)/*.md
title="The Learn'd Developer: Design Patterns"
filename='the-learn-d-developer-design-patterns'
all: html epub rtf pdf mobi
html:
pandoc -s $(source) -t html5 -o index.html -c style.css \
--include-in-header $(include_dir)/head.html \
--include-before-body $(include_dir)/author.html \
--include-after-body $(include_dir)/stats.html \
--title-prefix $(title) \
--normalize \
--smart \
--toc
epub:
pandoc -s $(source) --normalize --smart -t epub -o $(filename).epub \
--epub-metadata $(include_dir)/metadata.xml \
--epub-stylesheet epub.css \
--epub-cover-image chapters/img/placeholder.png \
--title-prefix $(title) \
--normalize \
--smart \
--toc
rtf:
pandoc -s $(source) -o $(filename).rtf \
--title-prefix $(title) \
--normalize \
--smart
pdf:
# You need `pdflatex`
# OS X: http://www.tug.org/mactex/
# Then find its path: find /usr/ -name "pdflatex"
# Then symlink it: ln -s /path/to/pdflatex /usr/local/bin
pandoc -s $(source) -o $(filename).pdf \
--title-prefix $(title) \
--normalize \
--smart \
--toc
mobi: epub
# Download: http://www.amazon.com/gp/feature.html?ie=UTF8&docId=1000765211
# Symlink bin: ln -s /path/to/kindlegen /usr/local/bin
kindlegen $(filename).epub