forked from boisgera/POO-Java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build
executable file
·53 lines (47 loc) · 867 Bytes
/
build
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
#!/bin/bash
set -e
set -o pipefail
# Help
usage(){
echo "Usage: $0 [--pdf]"
}
# Options
PDF=false
while [ $# -gt 0 ]; do
case "$1" in
--pdf) PDF=true
;;
-h) usage
exit 0
;;
--help) usage
exit 0
;;
*) usage
exit 1
;;
esac
shift
done
# Markdown Documents
DOCS=()
for file in *.md; do
doc="${file%.*}"
if [ "$doc" != "README" ]; then
DOCS+=("$doc")
fi
done
# Output Directory
mkdir -p output
# Options
OPT=(--standalone)
OPT+=(-V lang=fr)
OPT+=(-t revealjs -V theme:white -V slideNumber:true)
# PDF Output
for doc in "${DOCS[@]}"; do
echo "Processing $doc ..."
pandoc "${OPT[@]}" -o "$doc".html "$doc".md
if [ $PDF = "true" ]; then
decktape --size 1600x900 automatic "$doc".html "$doc".pdf
fi
done