-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·37 lines (31 loc) · 864 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
#!/usr/bin/env bash
function build_html {
docker run --rm -it -v `pwd`:/documents/ asciidoctor/docker-asciidoctor asciidoctor -r asciidoctor-diagram -o builds/html/index.html index.adoc
cp ./images/* builds/html/images
}
function build_epub {
docker run --rm -it -v `pwd`:/documents/ asciidoctor/docker-asciidoctor asciidoctor-epub3 -r asciidoctor-diagram -o builds/liceo.epub index.adoc
}
function build_pdf {
docker run --rm -it -v `pwd`:/documents/ asciidoctor/docker-asciidoctor asciidoctor-pdf -r asciidoctor-diagram -o builds/liceo.pdf index.adoc
}
function usage {
echo "build.sh pdf|epub|all"
}
case $1 in
html)
build_html
;;
pdf)
build_pdf
;;
epub)
build_epub
;;
all)
build_pdf && build_epub && build_html
;;
*)
usage
;;
esac