-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
61 lines (50 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
include_dir=build
source=capitulos/*.md
title='Git - Manual de usuario'
filename=git_manual
distdir=dist
all: html epub rtf pdf
dist_dir:
mkdir -p $(distdir)
markdown: dist_dir
awk 'FNR==1{print ""}{print}' $(source) > $(distdir)/$(filename).md
html: markdown
mkdir -p $(distdir)/html
cp $(include_dir)/style.css $(distdir)/html
cp -r img $(distdir)/html
pandoc -s $(distdir)/$(filename).md -t html5 -o $(distdir)/html/index.html -c style.css \
--include-in-header $(include_dir)/head.html \
--include-before-body $(include_dir)/author.html \
--include-before-body $(include_dir)/share.html \
--title-prefix $(title) \
--normalize \
--smart \
--toc
#--include-after-body $(include_dir)/stats.html
epub: markdown
pandoc -s $(distdir)/$(filename).md --normalize --smart -t epub -o $(distdir)/$(filename).epub \
--epub-metadata $(include_dir)/metadata.xml \
--epub-stylesheet $(include_dir)/epub.css \
--title-prefix $(title) \
--normalize \
--smart \
--toc
#--epub-cover-image img/cover.jpg
rtf: markdown
pandoc -s $(distdir)/$(filename).md -o $(distdir)/$(filename).rtf \
--title-prefix $(title) \
--normalize \
--smart
pdf: markdown
pandoc -s $(distdir)/$(filename).md -o $(distdir)/$(filename)_tmp.pdf \
--title-prefix $(title) \
--normalize \
--smart \
--toc \
--latex-engine=`which xelatex`
pdftk $(include_dir)/cover.pdf $(distdir)/$(filename)_tmp.pdf cat output $(distdir)/$(filename).pdf
rm $(distdir)/$(filename)_tmp.pdf
#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 $(distdir)/$(filename).epub