#!/bin/sh

# Crude script to convert formatted manual pages to HTML

echo '<html> <body> <pre>'

sed '
	s/\([<>&]\)\1/\1/g
	s/&/\&amp;/g
	s/</\&lt;/g
	s/>/\&gt;/g
	s;_\([^_]\);<i>\1</i>;g
	s;.\(.\);<b>\1</b>;g
	s;</i>\( *\)<i>;\1;g
	s;</b>\( *\)<b>;\1;g
' "$@"

echo '</pre> </body> </html>'
