X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=scripts%2Fbuild_doc.sh;h=6362075a3cef7589d6cccaf22ebbf8c1f431b576;hb=75603a224c1bc962d18e9398972fa3bf2ff77f87;hp=0f3a7af3c2c3c31055b195ae782408b5f975a3f2;hpb=1323773a00d2e50b08a5be4415c24c871742c201;p=kivitendo-erp.git diff --git a/scripts/build_doc.sh b/scripts/build_doc.sh index 0f3a7af3c..6362075a3 100755 --- a/scripts/build_doc.sh +++ b/scripts/build_doc.sh @@ -1,7 +1,7 @@ #!/bin/bash # Usage: -# cd /path/to/lx-office +# cd /path/to/kivitendo # ./scripts/build_doc.sh set -e @@ -11,16 +11,21 @@ if [[ ! -d doc ]]; then exit 1 fi +doc=${PWD}/doc + html=1 pdf=1 +images=1 if [[ ! -z $1 ]] ; then html=0 pdf=0 + images=0 while [[ ! -z $1 ]] ; do case $1 in - html) html=1 ;; - pdf) pdf=1 ;; + html) html=1 ;; + pdf) pdf=1 ;; + images) images=1 ;; *) echo "Unknown parameter $1" exit 1 @@ -52,18 +57,30 @@ custom=${base}/custom-cfg rm -rf ${input} ${custom} mkdir ${input} ${input}/copy_to_output ${custom} -cp ../../dokumentation.xml ${input}/ -cp -R ../../images ${input}/copy_to_output/ -cp -R ../custom-cfg/* ${custom}/ +cp ${doc}/dokumentation.xml ${input}/ +test -d ${doc}/images && cp -R ${doc}/images ${input}/copy_to_output/ +cp -R ${doc}/build/custom-cfg/* ${custom}/ if [[ $pdf = 1 ]] ; then ./generator.sh dokumentation pdf - cp ${output}/pdf/dokumentation.pdf ../../Lx-Office-Dokumentation.pdf + cp ${output}/pdf/dokumentation.pdf ${doc}/kivitendo-Dokumentation.pdf fi if [[ $html = 1 ]]; then ./generator.sh dokumentation html - rm -rf ../../html - mkdir ../../html - cp -R ${output}/html ../../ + rm -rf ${doc}/html + mkdir ${doc}/html + cp -R ${output}/html ${doc}/ +fi + +if [[ $images = 1 ]]; then + # copy system images from Dobudish directory + image_list=$(mktemp) + perl -nle 'print $1 while m{ (?: \.\./ )+ ( system/ [^\"]+ ) }xg' ${doc}/html/*.html | sort | uniq > $image_list + if [[ -s $image_list ]]; then + tar -c -f - -T $image_list | tar -x -f - -C ${doc}/html + perl -pi -e 's{ (\.\./)+ system }{system}xg' ${doc}/html/*.html + fi + + rm $image_list fi