4 # cd /path/to/kivitendo
5 # ./scripts/build_doc.sh
9 if [[ ! -d doc ]]; then
10 echo "Please run this from the installation directory."
16 if [[ ! -d doc/build/dobudish ]]; then
17 echo " ERROR: looks like 'doc/build/dobudish' DIR is missing"
18 echo " - You need to get 'dobudish-nojre-1.1.4.zip' from https://code.google.com/archive/p/dobudish/downloads"
19 echo " - Download and unpack ( unzip dobudish-nojre-1.1.4.zip -d doc/build )"
20 echo " - create dobudish symlink ( ln -sf dobudish-1.1.4 doc/build/dobudish )"
27 if [[ ! -z $1 ]] ; then
31 while [[ ! -z $1 ]] ; do
37 echo "Unknown parameter $1"
48 base=documents/dokumentation
49 if [[ ! -d $base ]]; then
50 ./generator.sh dokumentation create book
55 custom=${base}/custom-cfg
57 rm -rf ${input} ${custom}
58 mkdir ${input} ${input}/copy_to_output ${custom}
60 cp ${doc}/dokumentation.xml ${input}/
61 test -d ${doc}/images && cp -R ${doc}/images ${input}/copy_to_output/
62 cp -R ${doc}/build/custom-cfg/* ${custom}/
64 if [[ $pdf = 1 ]] ; then
65 ./generator.sh dokumentation pdf
66 cp ${output}/pdf/dokumentation.pdf ${doc}/kivitendo-Dokumentation.pdf
69 if [[ $html = 1 ]]; then
70 ./generator.sh dokumentation html
73 cp -R ${output}/html ${doc}/
76 if [[ $images = 1 ]]; then
77 # copy system images from Dobudish directory
79 perl -nle 'print $1 while m{ (?: \.\./ )+ ( system/ [^\"]+ ) }xg' ${doc}/html/*.html | sort | uniq > $image_list
80 if [[ -s $image_list ]]; then
81 tar -c -f - -T $image_list | tar -x -f - -C ${doc}/html
82 perl -pi -e 's{ (\.\./)+ system }{system}xg' ${doc}/html/*.html