NetBSD/gnu/dist/postfix/mantools/html2readme
2004-04-27 04:12:43 +00:00

27 lines
397 B
Bash
Executable File

#!/bin/sh
HTML2TEXT="html2text -style pretty -rcfile html2text.rc"
#case $# in
# 0) $HTML2TEXT;;
# *) for file
# do
# cat <<EOF | fmt
#[hyperlinked version: www.postfix.org/$file]
#EOF
# $HTML2TEXT $file
# done;;
#esac | sed '
$HTML2TEXT "$@" | sed '
:top
/ -$/ {
N
s/ -\n o/ -o/
b top
}
' | awk '
/^$/ && prev_len == 0 { next }
{ print; prev_len = length }
'