diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 19:59:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 19:59:03 +0000 |
commit | a848231ae0f346dc7cc000973fbeb65b0894ee92 (patch) | |
tree | 44b60b367c86723cc78383ef247885d72b388afe /mantools/man2html | |
parent | Initial commit. (diff) | |
download | postfix-a848231ae0f346dc7cc000973fbeb65b0894ee92.tar.xz postfix-a848231ae0f346dc7cc000973fbeb65b0894ee92.zip |
Adding upstream version 3.8.5.upstream/3.8.5
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mantools/man2html')
-rwxr-xr-x | mantools/man2html | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/mantools/man2html b/mantools/man2html new file mode 100755 index 0000000..3f78eff --- /dev/null +++ b/mantools/man2html @@ -0,0 +1,49 @@ +#!/bin/sh + +# Crude script to convert formatted manpages to HTML. Requires GROFF_NO_SGR. + +while : +do + case $1 in + -t) title=$2; shift; shift;; + -*) echo "Usage: $0 [-t title] [file(s)]" 1>&2; exit 1;; + *) break;; + esac +done + +echo "<!doctype html public \"-//W3C//DTD HTML 4.01 Transitional//EN\" + \"http://www.w3.org/TR/html4/loose.dtd\"> +<html> <head> +<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"> +<link rel='stylesheet' type='text/css' href='postfix-doc.css'> +<title> $title </title> +</head> <body> <pre>" + +#ESC=`echo x | tr '[x]' '[\033]'` + +sed ' + s/\([<>&]\)\1/\1/g + s/&/\&/g + s/_</\</g + s/<</\</g + s/</\</g + s/_>/\>/g + s/>>/\>/g + s/>/\>/g + s;_\([^_]\);<i>\1</i>;g + s;.\(.\);<b>\1</b>;g + + s;</i>\( *\)<i>;\1;g + s;</b>\( *\)<b>;\1;g + + # Skip the redundant readme/html_directory blurb. The + # document names that follow will be hyperlinked. + /^<b>README FILES/{ + h + N + N + g + } +' "$@" + +echo '</pre> </body> </html>' |