X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Fupdate-online-help;h=cb3fd98ac174d7fc83359cc0b4af29d1c73319d0;hb=a60df189656a5ba4706311fa52b55c9dd8816ee1;hp=73062f15def393d4213cc064821264335d5f1b8f;hpb=47d9abbc98056723fcde3131a70713d6fd075d8d;p=gosa.git diff --git a/gosa-core/update-online-help b/gosa-core/update-online-help index 73062f15d..cb3fd98ac 100755 --- a/gosa-core/update-online-help +++ b/gosa-core/update-online-help @@ -1,42 +1,134 @@ -#!/bin/sh +#!/bin/bash # Defaults for Debian CNV=`pwd`/contrib/latex2html -LYX=lyx-qt +LYX=lyx # Sanity checks -if [ ! -d doc/guide/user ]; then - echo "Can't find usable documentation structure - aborting" +if [ ! -d doc/core ]; then + echo "Can't find usable core documentation structure - aborting" exit 1 fi # Commands present? for cmd in $CNV $LYX; do - if ! which $cmd &> /dev/null; then + if [[ ! `which $cmd` ]]; then echo "Can't find executable for '$cmd' - aborting" exit 2 fi done +# Create guide.xml +cat << EOF > doc/guide.xml + + + + + + + +EOF + +echo -en "Generating doc/guide.xml..." +# core guide.xml +pushd . &> /dev/null +cd doc/core +cat < guide.xml >> ../guide.xml +popd &> /dev/null + +# plugins guide.xml pushd . &> /dev/null -cd doc/guide/user +if [ -d doc/plugins ]; then + cd doc/plugins + for plugin in *; do + [ -r $plugin/guide.xml ] && cat < $plugin/guide.xml >> ../guide.xml + done +fi +popd &> /dev/null +echo -en "\n" >> doc/guide.xml +sed -i s/"[ \t][ \t]*"/" "/g doc/guide.xml +echo -en " done.\n" + +# Core help +echo -en "Processing core\n" +pushd . &> /dev/null +cd doc/core for lang in *; do [ ! -d "$lang" ] && continue pushd . &> /dev/null - echo "Processing language $lang..." + echo -en "\tProcessing language $lang...\n" cd $lang/lyx-source - for source in *.lyx; do - $LYX -e latex $source; d=../html/${source%%\.*}/ > /dev/null + for source in $(find . -name \*.lyx -exec basename {} \;); do + echo -en "\t\tProcessing $source..." + echo -en " tex" + $LYX -e latex $source &> /dev/null + d=../html/${source%%\.*}/ [ -d $d ] || mkdir -p $d && rm -r $d/* &> /dev/null - $CNV -no_navigation -dir $d ${source%%\.*}.tex > /dev/null + echo -en " html" + $CNV -no_navigation -dir $d ${source%%\.*}.tex &> /dev/null + echo -en " cleanup" + rm images/*.eps &> /dev/null + rm ${source%%\.lyx}.tex &> /dev/null + echo -en " done.\n" + continue done - popd &> /dev/null done +popd &> /dev/null + +# Plugin help +pushd . &> /dev/null +if [ -d doc/plugins ]; then + cd doc/plugins + + for plugin in *; do + pushd . &> /dev/null + echo -en "Processing $plugin\n" + cd $plugin + for lang in *; do + [ ! -d "$lang" ] && continue + + pushd . &> /dev/null + echo -en "\tProcessing language $lang...\n" + cd $lang/lyx-source + + for source in $(find . -name \*.lyx -exec basename {} \;); do + echo -en "\t\tProcessing $source..." + echo -en " tex" + $LYX -e latex $source &> /dev/null + d=../html/${source%%\.*}/ + [ -d $d ] || mkdir -p $d && rm -r $d/* &> /dev/null + echo -en " html" + $CNV -no_navigation -dir $d ${source%%\.*}.tex &> /dev/null + echo -en " cleanup" + rm images/*.eps &> /dev/null + rm ${source%%\.lyx}.tex &> /dev/null + echo -en " done.\n" + continue + done + popd &> /dev/null + done + popd &> /dev/null + done + +fi popd &> /dev/null echo exit 0