#! /bin/sh

#================================================================
# texttohtml
# Escape meta character of HTML
#================================================================


# print header
cat <<__EOF
<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<title>Generated by texttohtml</title>
</head>
<body>
<pre>
__EOF


# print body
cat $1 | sed -e 's/&/\&amp;/g' -e 's/</\&lt;/g' -e 's/>/\&gt;/g'


# print footer
cat <<__EOF
</pre>
</body>
</html>
__EOF


# exit normally
exit 0



# END OF FILE
