#!/bin/sh
# filter to convert Tk and Tcl man pages to html equivalents
# does not do any linking !!!!
TOP=`pwd`
if [ $# -eq 0 ] ; then
echo "Usage $0 filename"
exit
fi
cat $1 |
sed -e 's/\\-/-/g' \
-e 's/\\[0&]/ /g' \
-e 's/&/\&/g' \
-e 's/\</g' \
-e 's/>/\>/g' \
-e 's/\\|//g' \
-e 's/\\e/\\/g' |
/usr/bin/nawk -f ${TOP}/tk2html.awk |
sed -e 's^\\fB\([^\\]*\)\\fR^\1^g' \
-e 's^\\fI\(.[^\\]*\)\\fR^\1^g' \
-e 's^\\fB^^g' \
-e 's^\\fI^^g' \
-e 's^\\f[RP]^^g' \
-e 's/^.[LP]P/
/' \
-e 's/^.br/
/' \
-e 's/^\.DS.*/
/' \
-e 's$^\.DE.*$
$' \
-e 's/^\.nf */$' \
-e 's$^\.BE *$
$' \
-e 's/^\.RS.*/$' \
-e 's^\.SH *"*\([^"]*\)"*^\1
^' \
-e 's/^\.[a-zA-Z]*.*//' \
-e 's/^`\\\".*//' |
/usr/bin/nawk -f ${TOP}/tk2html2.awk
# The above handling for font mapping to html works correctly in about 95% of
# the cases, the others turn out stacking the font setting so you get the
# font bleeding since it isn't being turned # off in the correct places.
# To correct we would have to record the current ( non-default) font and
# explicitly turn it off when another font change is detected.
# Which would make multiple styles impossible concurrently which seems to
# be the case anyway....