2 # Id: install-info-html,v 1.3 2004/04/11 17:56:47 karl Exp
23 Install HTML info document.
25 Usage: $name [OPTION]... [DOCUMENT-DIR]...
28 -a,--all assume all subdirectories of index to be DOCUMENT-DIRs
29 -d,--dir=DIR set index directory to DIR (default=.)
30 -D,--debug print debugging info
31 -h,--help this help text
32 -v,--version show version
39 $debug_echo "cleaning ($?)..."
45 # Find command line options and switches
48 # "x:" x takes argument
52 # ugh, "\-" is a hack to support long options
53 # must be in double quotes for bash-2.0
55 while getopts "\-:$options" O
57 $debug_echo "O: \`$O'"
58 $debug_echo "arg: \`$OPTARG'"
64 [ "$debug_echo" = "echo" ] && set -x
85 [ "$debug_echo" = "echo" ] && set -x
93 index_dir="`expr \"$OPTARG\" ':' '[^=]*=\(.*\)'`"
100 echo "$0: invalid option -- \"$OPTARG\""
107 shift `expr $OPTIND - 1`
112 if [ -z "$all" ] && [ -z "$1" ]; then
114 echo "$name: No HTML documents given"
118 if [ -n "$all" ] && [ -n "$1" ]; then
119 echo "$name: --all specified, ignoring DIRECTORY-DIRs"
122 if [ -n "$all" ]; then
123 document_dirs=`/bin/ls -d1 $index_dir`
128 index_file=$index_dir/index.html
130 echo -n "$name: Writing index: $index_file..."
133 cat >> $index_file <<EOF
135 <head><title>Info documentation index</title></head>
137 <h1>Info documentation index</h1>
138 This is the directory file \`index.html' a.k.a. \`DIR', which contains the
139 topmost node of the HTML Info hierarchy.
141 This is all very much Work in Progress (WiP).
147 for i in $document_dirs; do
148 echo "<li> <a href=\"$i/$i.html\">$i</a></li>"
152 cat >> $index_file <<EOF