Home | History | Annotate | Line # | Download | only in mantools
      1      1.1      tron #!/bin/sh
      2      1.1      tron 
      3  1.1.1.2  christos HTML2TEXT="html2text -ascii -style pretty -rcfile html2text.rc"
      4      1.1      tron 
      5      1.1      tron #case $# in
      6      1.1      tron # 0) $HTML2TEXT;;
      7      1.1      tron # *) for file 
      8      1.1      tron #    do
      9      1.1      tron #        cat <<EOF | fmt
     10      1.1      tron #[hyperlinked version: www.postfix.org/$file]
     11      1.1      tron #EOF
     12      1.1      tron #         $HTML2TEXT $file
     13      1.1      tron #    done;;
     14      1.1      tron #esac | sed '
     15      1.1      tron 
     16      1.1      tron $HTML2TEXT "$@" | sed '
     17      1.1      tron :top
     18      1.1      tron / -$/ {
     19      1.1      tron 	N
     20      1.1      tron 	s/ -\n  o/ -o/
     21      1.1      tron 	b top
     22      1.1      tron }
     23  1.1.1.2  christos /^  \*$/ {
     24  1.1.1.2  christos 	N
     25  1.1.1.2  christos 	s/\*\n    /* /
     26  1.1.1.2  christos 	b top
     27  1.1.1.2  christos }
     28      1.1      tron ' | awk '
     29      1.1      tron /^$/ && prev_len == 0 { next }
     30      1.1      tron 		      { print; prev_len = length }
     31      1.1      tron '
     32