|
|
  We often have to include HTML listings in our articles. Txt2html does just what it says. The homepage is located here. I know what you are thinking. This is a text to HTML converter, why do we use it to render HTML as text? Well, what we are looking for is to treat our HTML as text, and then put it into our grey box. Of course, the grey box is all HTML, as is the site, so we don't want the output to have any HTML in it. So, we are treating HTML as text so we can convert it back to HTML again. For an example of this, see this article. If you are using PHPNuke, you might be interested in this article.
To convert HTML to text for our purposes, we run:
# txt2html --extract --prebegin 0 --preend 0 sysdocadd.html > sysdoca.txt
# cat sysdoca.txt
<html>
<head>
<title>SystemsDoc Add</title>
</head>
<body bgcolor="white">
<form method="POST" action="sysdocadd.php">
<table>
<col span="1" align="right">
<tr>
<td><font color="blue">Manufacturer:</font></td>
<td><input type="text" name="manu" size=100></td>
</tr>
<tr>
<td><font color="blue">Model:</font></td>
<td><input type="text" name="model" size=100></td>
</tr>
<tr>
<td><font color="blue">Address:</font></td>
<td><input type="text" name="addr" size=100></td>
</tr>
<tr>
<td><font color="blue">Zip:</font></td>
<td><input type="text" name="zip" size=100></td>
</tr>
<tr>
<td><font color="blue">Phone:</font></td>
<td><input type="text" name="phone" size=100></td>
</tr>
<tr>
<td><font color="blue">Deployment Date:</font></td>
<td><input type="text" name="deploy_date" size=100></td>
</tr>
<tr>
<td><font color="blue">Serial Number:</font></td>
<td><input type="text" name="sernum" size=100></td>
</tr>
<tr>
<td><font color="blue">Asset Number:</font></td>
<td><input type="text" name="assetnum" size=100></td>
</tr>
<tr>
<td><font color="blue">Machine Name:</font></td>
<td><input type="text" name="machname" size=100></td>
</tr>
<tr>
<td><font color="blue">System Version:</font></td>
<td><input type="text" name="sysversion" size=100></td>
</tr>
<tr>
<td><font color="blue">UID:</font></td>
<td><input type="text" name="UID" size=100></td>
</tr>
<tr>
<td><input type="submit" value="Submit"></td>
</tr>
</table>
</form>
</body>
</html>
#
|
There was a leading PRE tag that we had to remove, but besides that, this was a very easy way to insert an HTML file into an article. If you would like to see what the output was here is the output. Note that IE sometimes renders plain text files, so you might need to right-click and save to disk.
|
|