#!/bin/sh
# Crude script to convert plain READMEs to HTML
echo '
Title Here
Title Here
'
sed '
s/&/\&/g
s/\</g
s/>/\>/g
' "$@" | awk '
/^====+$/ { print "" line "
"; line = ""; getline; next }
NF == 0 { print line; print $0; print ""; line = $0; next }
{ print line; line = $0 }
END { print line }
'
echo '
'