1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<TITLE>txt2html Sample Conversion</TITLE>
<META NAME="generator" CONTENT="txt2html v1.28">
</HEAD>
<BODY>
<P>
<A HREF="http://www.aigeek.com/txt2html/">txt2html</A> Sample Conversion
<P>
I used the following command to convert this document:
<P>
txt2html -tf --mail -H '^ *--[\w\s]+-- *$' -a sample.foot sample.txt > sample.html
<HR>
<!-- New Message -->
<p>
<A NAME="0">From</A> <A HREF="mailto:bozo@clown.wustl.edu">bozo@clown.wustl.edu</A><BR>
Return-Path: <<A HREF="mailto:bozo@clown.wustl.edu">bozo@clown.wustl.edu</A>><BR>
Message-Id: <<A HREF="mailto:9405102200.AA04736@clown.wustl.edu">9405102200.AA04736@clown.wustl.edu</A>><BR>
Content-Length: 1070<BR>
From: <A HREF="mailto:bozo@clown.wustl.edu">bozo@clown.wustl.edu</A> (Bozo the Clown)<BR>
To: <A HREF="mailto:seth@aigeek.com">seth@aigeek.com</A> (<A HREF="http://www.aigeek.com/">Seth Golub</A>)<BR>
Subject: Re: txt2html<BR>
Date: Fri, 6 May 94 10:01:10 -0500
<P>
Bozo wrote:<BR>
BtC> Can you post an example text file with its html'ed output?<BR>
BtC> That would provide a much better first glance at what it does<BR>
BtC> without having to look through and see what the perl code does.
<P>
Good idea. I'll write something up.
<HR>
<P>
The header lines were kept separate because they looked like mail
headers and I have mailmode on. The same thing applies to Bozo's
quoted text. Mailmode doesn't screw things up very often, but since
most people are usually converting non-mail, it's off by default.
<P>
Paragraphs are handled ok. In fact, this one is here just to
demonstrate that.
<P>
<STRONG>THIS LINE IS VERY IMPORTANT!</STRONG><BR>
(Ok, it wasn't <EM>that</EM> important)
<H1><A NAME="section-1.">EXAMPLE HEADER</A></H1>
<P>
Since this is the first header noticed (all caps, underlined with an
"="), it will be a level 1 header. It gets an anchor named
"section-1".
<H2><A NAME="section-1.1.">Another example</A></H2>
This is the second type of header (not all caps, underlined with "=").
It gets an anchor named "section-1.1".
<H2><A NAME="section-1.2.">Yet another example</A></H2>
<P>
This header was in the same style, so it was assigned the same header
tag. Note the anchor names in the HTML. (You probably can't see them
in your current document view.) Its anchor is named "section-1.2".
Get the picture?
<H3><A NAME="section-1.2.1.">-- This is a custom header --</A></H3>
<P>
You can define your own custom header patterns if you know what your
documents look like.
<H2><A NAME="section-1.3.">Features of txt2html</A></H2>
<UL>
<LI>Handles different kinds of lists
<OL>
<LI>Bulleted
<LI>Numbered
<UL>
<LI>You can nest them as far as you want.
<LI>It's pretty decent about figuring out which level of list it
is supposed to be on.
<UL>
<LI>You don't need to change bullet markers to start a new list.
</UL>
</UL>
<LI>Lettered
<OL>
<LI>Finally handles lettered lists
<LI>Upper and lower case both work
<OL>
<LI>Here's an example
<LI>I've been meaning to add this for some time.
</OL>
<LI>Of course, HTML can't specify how ordered lists should be
<P>
indicated, so it may be a numbered list in some
browsers. (Ok, most browsers)
</OL>
</OL>
<LI>Doesn't screw up mail-ish things
<LI>Spots preformated text sometimes
</UL>
<PRE>
It just needs to have enough whitespace in the line.
Surrounding blank lines aren't necessary. If it sees enough
whitespace in a line, it preformats it. How much is enough?
Set it yourself at command line if you want.
</PRE>
<UL>
<LI>You can append a file automatically to all converted files. This
is handy for adding signatures to your documents.
<LI>Deals with paragraphs decently.
<UL>
<LI>looks for short lines in the middle of paragraphs and keeps them
short with the use of breaks (<BR>). How short the lines need to
be is configurable.
<LI>Unhyphenates split words that are in the middle of paragraphs.
Let me know if trailing punctuation isn't handled "properly".
It should be.
</UL>
<LI>Puts anchors at all headers and, if you're using the mail header
features, at the beginning of each mail message. The anchor names
for headings are based on guessed section numbers.
<LI>Groks Mosaic-style "formatted text" headers (like the one below)
<LI>Can hyperlink things according to a dictionary file.
The sample dictionary handles URLs like
<A HREF="http://www.aigeek.com/">http://www.aigeek.com/</A> and also shows how to do simpler
things such as linking the word txt2html the first time it appeared.
</UL>
<H4><A NAME="section-1.3.1.1.">Example of short lines</A></H4>
<P>
We're the knights of the round table<BR>
We dance whene'er we're able<BR>
We do routines and chorus scenes<BR>
With footwork impeccable.<BR>
We dine well here in Camelot<BR>
We eat ham and jam and spam a lot.
<HR>
<P>
The signature is everything from the end of this sentence to the
</BODY> tag.
<HR>
<ADDRESS>
<A href="http://www.aigeek.com/">seth@aigeek.com</A>
</ADDRESS>
</BODY>
</HTML>
|