#!/bin/sh # # text2html.sh - convert plain text to HTML document # $Id: text2html.sh,v 1.6 1995/08/02 04:34:02 saka Exp $ # Copyright (C) 1994, by Tetsuo Sakaguchi, # University of Library and Information Science. (saka@ulis.ac.jp) # tojis='jconv -j' cat "$@" \ | sed -e 's/&/\&/g' \ -e 's/\</g' \ -e 's/>/\>/g' \ -e 's/"/\"/g' \ | awk ' BEGIN { print ""; print "
"; print ""; } p = 1; } } pre == 0 && n == 2 { if (ul != 0) { print ""; ul = 0; } if (h2 != 0) { print ""; } if (address != 0) { print "
"; address = 0; } print ""; } else { print ""; h2 = 0; } p = 0; } { n = 0; if ($0 ~ /^\t/) { if (pre == 0) { print "
"; } print substr($0, 2); pre = 1; } else { if ($0 ~ /^¡¦/) { print jsubstr($0, 2); } else { print; } } if (address != 0) { print ""; } if (ul != 0) { print ""; } if (h1 != 0) { print ""; } if (address != 0) { print ""; } print ""; print ""; }' \ | sed -e 's/ / /g' \ | ${tojis}
"; } } END { if (h2 != 0) { print ""; } if (pre != 0) { print "