forked from filecoin-project/specs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-pdf.sh
executable file
·69 lines (61 loc) · 1.37 KB
/
build-pdf.sh
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
#!/bin/sh
set -e
short=$(git rev-parse --short HEAD)
tag=${1-$short}
files=(
INTRO.md
data-structures.md
address.md
signatures.md
proofs.md
validation.md
network-protocols.md
bootstrap.md
data-propagation.md
sync.md
expected-consensus.md
state-machine.md
local-storage.md
operation.md
actors.md
mining.md
storage-market.md
retrieval-market.md
payments.md
faults.md
zigzag-circuit.md
zigzag-porep.md
definitions.md
style.md
process.md
)
rm -rf .pdfworking
mkdir -p .pdfworking
mkdir -p pdf-build
i=0
for f in ${files[@]}; do
printf -v n "%03d" $i
cp "./${f}" "./.pdfworking/${n}_${f}"
i=$((i + 1))
done
find ./.pdfworking -type f -exec sed -i "" 's/{{%.*%}}//g' {} \;
pandoc ./.pdfworking/*.md \
--pdf-engine xelatex \
-o "pdf-build/filecoin-spec-$tag".pdf \
--from markdown+grid_tables \
--template ./pdf/eisvogel.tex \
-H ./pdf/helpers.tex \
--listings \
--toc \
-V titlepage=true \
-V titlepage-color=FFFFFF \
-V titlepage-rule-color=FFFFFF \
-V titlepage-rule-height=0 \
-V logo="./pdf/cover-src.jpg" \
-V logo-width="120" \
-V listings-disable-line-numbers=true \
-V block-headings=true \
-V mainfont="Georgia" \
--metadata title="Filecoin Specification $tag"
rm -rf .pdfbuild
echo "filecoin-spec-$tag.pdf"