summaryrefslogtreecommitdiffstats
path: root/mantools/readme2html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 01:46:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 01:46:30 +0000
commitb5896ba9f6047e7031e2bdee0622d543e11a6734 (patch)
treefd7b460593a2fee1be579bec5697e6d887ea3421 /mantools/readme2html
parentInitial commit. (diff)
downloadpostfix-upstream.tar.xz
postfix-upstream.zip
Adding upstream version 3.4.23.upstream/3.4.23upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mantools/readme2html')
-rwxr-xr-xmantools/readme2html36
1 files changed, 36 insertions, 0 deletions
diff --git a/mantools/readme2html b/mantools/readme2html
new file mode 100755
index 0000000..64b5111
--- /dev/null
+++ b/mantools/readme2html
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+# Crude script to convert plain READMEs to HTML
+
+echo '<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+
+<html>
+
+<head>
+
+<title>Title Here</title>
+
+<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
+
+</head>
+
+<body>
+
+<h1>Title Here</h1>'
+
+sed '
+ s/&/\&amp;/g
+ s/</\&lt;/g
+ s/>/\&gt;/g
+' "$@" | awk '
+/^====+$/ { print "<h2>" line "</h2>"; line = ""; getline; next }
+NF == 0 { print line; print $0; print "<p>"; line = $0; next }
+ { print line; line = $0 }
+END { print line }
+'
+
+echo '
+</body>
+
+</html>'