-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sh
executable file
·50 lines (40 loc) · 849 Bytes
/
build.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
#!/usr/bin/env bash
SLIDES_HTML=slides.html
SLIDES_SOURCE=slides.md
LESSC=$(type -p lessc)
PANDOC=$(type -p pandoc)
GIT=$(type -p git)
die() {
echo "$@" >&2
exit 1
}
if [ -z "$PANDOC" ]
then
die "Can't find pandoc executable in path."
fi
if [ -z "$GIT" ]
then
die "Can't find git executable in path."
fi
if [ -z "$LESSC" ]
then
die "Can't find lessc executable in path."
fi
if [ ! -d "reveal.js" ]
then
echo "Cloning reveal.js Git repo..."
$GIT clone https://github.com/hakimel/reveal.js.git
fi
echo "Creating CSS..."
lessc style.less style.css || die "lessc failed."
echo "Building slides..."
$PANDOC \
--self-contained \
--css style.css \
-i \
-t revealjs \
-s \
-o $SLIDES_HTML \
$SLIDES_SOURCE || \
die "pandoc failed."
echo "Done. Standalone reveal.js slide presentation is in $SLIDES_HTML."