1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
#!/bin/sh
#
# Script to convert doc/*.txt to html/*.html for -H option.
# Must re re-run after any change to any of the *.txt files
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# Please see the file `COPYING' for the complete copyright notice.
#
#
CNT=0
# Where are we?
DIR=`dirname $0`
if [ -z "$1" ]; then
# If called without arguments we run over all the text files under doc
set ../doc/*.txt
fi
while [ "$1" ]; do
OUTF=`echo $1 | sed -e "s/\.txt/.html/"`
TITLE=`echo $1 | sed -e "s/\.\.\/doc\///" | sed -e "s/\.txt//"`
if [ $CNT -eq 1 ]; then
echo "<HR><PRE>" > $OUTF
echo >> $OUTF
echo >> $OUTF
echo >> $OUTF
echo >> $OUTF
echo >> $OUTF
echo >> $OUTF
echo >> $OUTF
echo >> $OUTF
echo "</PRE><HR>" >> $OUTF
else
echo "<HR>" > $OUTF
fi
echo "<CENTER><H2> Documents for $TITLE</H2></CENTER>" >> $OUTF
echo "Doing $1"
cat $1 | sh $DIR/convert2html >> $OUTF
shift
CNT=1
done
|