diff options
| author | beatrice <beatrice@dangofactory.net> | 2026-11-22 19:19:03 +0900 |
|---|---|---|
| committer | beatrice <beatrice@dangofactory.net> | 2026-11-22 19:19:03 +0900 |
| commit | bd4611555e18fca7c66afaef0f094e15038b0459 (patch) | |
| tree | 1b1a9109567b61ac259ead146f4bef21a0f886df /mantools/readme2html | |
| parent | 2324a9e97a727bf95690c9fb8fdca0f52301940e (diff) | |
| download | postfix-master.tar.gz postfix-master.zip | |
Release tarball postfix-3.11.7.tar.gz (dist-generated files / local differences from tag)HEADlocal/postfixmaster
Diffstat (limited to 'mantools/readme2html')
| -rwxr-xr-x | mantools/readme2html | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/mantools/readme2html b/mantools/readme2html new file mode 100755 index 000000000..a1ec24a6e --- /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" + "https://www.w3.org/TR/html4/loose.dtd"> + +<html> + +<head> + +<title>Title Here</title> + +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> + +</head> + +<body> + +<h1>Title Here</h1>' + +sed ' + s/&/\&/g + s/</\</g + s/>/\>/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>' |
