source: branches/nameserver/GDEHELP/genhelptree.sh

Last change on this file was 10842, checked in by westram, 11 years ago
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.2 KB
Line 
1#!/bin/bash
2
3if [ -z "$5" ] ; then # need at least 2 'inputtext's
4    echo "Usage: genhelptree.sh outputfile title header [inputtext]+"
5    echo "       Generates help pre-sources 'outputfile_*' from several 'inputtext's"
6    echo "       Creates an index page."
7    exit 1
8fi
9
10INDEXFILE=$1
11MAINTITLE=$2
12HEADER=$3
13shift;shift;shift
14SED=${ARBHOME}/SH/arb_sed
15
16test -f $INDEXFILE && chmod u+w $INDEXFILE
17
18BASE=`echo $INDEXFILE | $SED -e 's/^.*\///' | $SED -e 's/.help//'`
19PREFIX=`echo $INDEXFILE | $SED -e 's/\/[^\/]*$//'`
20echo "BASE='$BASE' PREFIX='$PREFIX'"
21
22write_index() {
23    echo "$BASE [docindex]"
24    echo ""
25    echo "Documents provided with $BASE:"
26    echo ""
27#     cat $HEADER
28
29    while [ \! -z "$1" ]; do
30        SUBBASE=`echo $1 | $SED -e 's/^.*\///'`
31        ESCAPED_SUBBASE=`echo $SUBBASE | $SED -e 's/\./_/'`
32        echo "    - LINK{agde_${BASE}_sub_${ESCAPED_SUBBASE}.hlp}"
33        shift
34    done
35}
36
37write_index $* > $INDEXFILE
38test -f $INDEXFILE && chmod a-w $INDEXFILE
39
40while [ \! -z "$1" ]; do
41    SUBBASE=`echo $1 | $SED -e 's/^.*\///'`
42    ESCAPED_SUBBASE=`echo $SUBBASE | $SED -e 's/\./_/'`
43    ./genhelp.sh $PREFIX/${BASE}_sub_$ESCAPED_SUBBASE.help "$SUBBASE" $HEADER $1
44    shift
45done
46
47# exit 1
Note: See TracBrowser for help on using the repository browser.