Expand PMF_FN_* macros.
[netbsd-mini2440.git] / external / ibm-public / postfix / dist / mantools / man2html
blobf3d949978523eac652d2186e40e14bbb9c3dbf73
1 #!/bin/sh
3 # Crude script to convert formatted manual pages to HTML
5 while :
6 do
7 case $1 in
8 -t) title=$2; shift; shift;;
9 -*) echo "Usage: $0 [-t title] [file(s)]" 1>&2; exit 1;;
10 *) break;;
11 esac
12 done
14 echo "<!doctype html public \"-//W3C//DTD HTML 4.01 Transitional//EN\"
15 \"http://www.w3.org/TR/html4/loose.dtd\">
16 <html> <head>
17 <meta http-equiv=\"Content-Type\" content=\"text/html; charset=us-ascii\">
18 <title> $title </title>
19 </head> <body> <pre>"
21 sed '
22 s/\([<>&]\)\b\1/\1/g
23 s/&/\&amp;/g
24 s/_\b</\&lt;/g
25 s/<\b</\&lt;/g
26 s/</\&lt;/g
27 s/_\b>/\&gt;/g
28 s/>\b>/\&gt;/g
29 s/>/\&gt;/g
30 s;_\b\([^_]\);<i>\1</i>;g
31 s;.\b\(.\);<b>\1</b>;g
32 s;</i>\( *\)<i>;\1;g
33 s;</b>\( *\)<b>;\1;g
34 ' "$@" | egrep -v 'postconf (readme|html)_direc|tory</b>" *to *locate *this'
36 echo '</pre> </body> </html>'