mirror of
https://github.com/GnoConsortium/gno.git
synced 2024-12-22 14:30:29 +00:00
58 lines
1.2 KiB
Plaintext
58 lines
1.2 KiB
Plaintext
|
#! /bin/sh
|
||
|
#
|
||
|
# Devin Reade, November 1997.
|
||
|
#
|
||
|
# $Id: mkhtmlman,v 1.1 1997/11/24 05:07:27 gdr Exp $
|
||
|
|
||
|
man2html=/usr/local/bin/man2html
|
||
|
TMPDIR=${TMPDIR:-/tmp}
|
||
|
|
||
|
#
|
||
|
# Make sure we know where everything is going.
|
||
|
#
|
||
|
if [ -z "$GNOROOT" ]; then
|
||
|
echo "GNOROOT variable not set"
|
||
|
exit 1
|
||
|
fi
|
||
|
if [ -z "$MANHTML" ]; then
|
||
|
echo "MANHTML variable not set"
|
||
|
exit 1
|
||
|
fi
|
||
|
if [ -z "$NAME" ]; then
|
||
|
echo "NAME variable not set"
|
||
|
exit 1
|
||
|
fi
|
||
|
if [ -z "$ADDR" ]; then
|
||
|
echo "ADDR variable not set"
|
||
|
exit 1
|
||
|
fi
|
||
|
set +e
|
||
|
|
||
|
listfile=$TMPDIR/mkhtmlman.1.$$
|
||
|
|
||
|
trap "rm -f $listfile" 0 1 2 15
|
||
|
|
||
|
MANDIRS="$GNOROOT/usr.man $GNOROOT/*bin* $GNOROOT/*lib*"
|
||
|
|
||
|
for section in 1 2 3 4 5 6 7 8; do
|
||
|
dest=$MANHTML/man$section
|
||
|
[ -d $dest ] || mkdir -p $dest
|
||
|
|
||
|
for F in 00.DUMMY `find $MANDIRS -type f -name '*.'$section -print \
|
||
|
| grep -v libcurses/PSD.doc`; do
|
||
|
[ "$F" = 00.DUMMY ] && continue;
|
||
|
f=`basename $F`
|
||
|
echo "creating $dest/$f.html"
|
||
|
echo "$f" >> $listfile
|
||
|
nroff -man $F | $man2html -nodepage | \
|
||
|
perl -p -e \
|
||
|
's/<BODY>/<title>GNO: '"$f($section)"'<\/title><body bgcolor=\#ffffff>/;' \
|
||
|
> $dest/$f.html
|
||
|
done
|
||
|
sort $listfile | \
|
||
|
./mkmandex -s$section -name="$NAME" -addr="$ADDR" -mkso="$MKSO" \
|
||
|
-hroot="$HTMLROOT" > $dest/00.index.html
|
||
|
rm $listfile
|
||
|
done
|
||
|
|