Auch HTML-Variante der Dokumentation bauen
[kivitendo-erp.git] / scripts / build_doc.sh
1 #!/bin/bash
2
3 # Usage:
4 #   cd /path/to/lx-office
5 #   ./scripts/build_doc.sh
6
7 set -e
8
9 if [[ ! -d doc ]]; then
10   echo "Please run this from the installation directory."
11   exit 1
12 fi
13
14 dobudish=$(ls -d doc/build/dobudish* 2> /dev/null)
15
16 if [[ -z $dobudish ]] || [[ ! -d ${dobudish} ]]; then
17   echo "There's no dobudish directory inside doc/build."
18   exit 1
19 fi
20
21 cd ${dobudish}
22
23 base=documents/dokumentation
24 if [[ ! -d $base ]]; then
25   ./generator.sh dokumentation create book
26 fi
27
28 input=${base}/input
29 output=${base}/output
30 custom=${base}/custom-cfg
31
32 rm -f ${input}/*.xml
33 cp ../../dokumentation.xml ${input}/
34
35 rm -f ${custom}/*
36 cp -R ../custom-cfg/* ${custom}/
37
38 ./generator.sh dokumentation pdf
39 cp ${output}/pdf/dokumentation.pdf ../../
40
41 ./generator.sh dokumentation html
42 rm -rf ../../html
43 mkdir ../../html
44 cp -R ${output}/html ../../html