From b7c15c31519dc44c1f691e0466badd556ffe9423 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 18:18:56 +0200 Subject: Adding upstream version 3.7.10. Signed-off-by: Daniel Baumann --- mantools/man2html | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100755 mantools/man2html (limited to 'mantools/man2html') diff --git a/mantools/man2html b/mantools/man2html new file mode 100755 index 0000000..db17bda --- /dev/null +++ b/mantools/man2html @@ -0,0 +1,48 @@ +#!/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 " + + + $title +
"
+
+#ESC=`echo x | tr '[x]' '[\033]'`
+
+sed '
+	s/\([<>&]\)\1/\1/g
+	s/&/\&/g
+	s/_/\>/g
+	s/>>/\>/g
+	s/>/\>/g
+	s;_\([^_]\);\1;g
+	s;.\(.\);\1;g
+
+	s;\( *\);\1;g
+	s;\( *\);\1;g
+
+	# Skip the redundant readme/html_directory blurb. The
+	# document names that follow will be hyperlinked.
+	/^README FILES/{
+		h
+		N
+		N
+		g
+	}
+' "$@"
+
+echo '
' -- cgit v1.2.3