#!/bin/sh
#
# This script generates automatically to its stdout a windex.html file;
# this file is useful just after running man2html.
# All the html man pages must be located under an html directory at the
# same level as the generated windex.html file.
#


WINDEX=$1

cat <<EOF
 <!-- This is an automatically generated file. Do Not Edit! 
      Use windex2html to generate it -->
 <center><h1>ACE Wrappers Man Pages Index</h1></center>
 <p>
 This file has been generated from the <i>windex</i> file from the ACE package 
 and it contains a list of pointers to the man2html'ed man pages.
 <p>
 <HR>
 <UL>
EOF

cat $WINDEX | \
  sed -e 's/		/	/g'  \
      -e 's%\(3\).*-%3\)</a>%g'      \
      -e 's/^[a-zA-Z_]*/&\.html">/g' \
      -e 's/\.PP/<BR>/g'             \
      -e 's%^%<li><a HREF="html/%g'  \
      -e 's%\\f(CO[a-zA-Z_]*%<CODE>&</B></I></CODE>%g' \
      -e 's%\\f(CO%%g'

echo "</UL>"
