home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
txt2html.zip
/
README
< prev
next >
Wrap
Text File
|
1998-09-21
|
8KB
|
206 lines
TXT2HTML Version 1.5
(ASCII text -> HTML converter)
1. Txt2HTML.
Do You want 'to dress' simple ASCII text with URLs by HTML tags?
The aim of this program is to simplify the procedure of creating
of HTML document from ordinary ASCII text.
Txt2HTML solves two different tasks:
- converting some elements in text: special characters (<,>,",&,umlauts),
URL-like words (http://somewhere.com, www.w3.org, me@anynet.com)
and image-name (image.gif, image.jpg).
- inserting some format tags into text: paragraphs, headers, horizontal
rules, definition lists, preformatted fragments, tables.
There is a lot of 'txt' to 'html' converters...
Why did I write another one? My program uses ordinary text
without *any* special treatment and produces readable HTML
without *any* interference from user.
2. Installation.
2.1. Simplest.
Add txt2html.exe to any directory included in PATH.
This program uses EMX runtime dlls. If you have no
EMX installed, you can download EMX-free version
from http://wgc.chem.pu.ru/personal/valera/mypub/txt2html_nonEMX.zip
To observe the possibilities of txt2html, run 'txt2html test.txt'
and look at test.html!
2.2. PM Front-end
You can use PM front-end for txt2html - PMtxt2html.
Otherwize, delete PMtx2html.exe and PMtxt2html.hlp !
2.3. Customization.
You can preview obtained file by Netscape or WebExplorer
(I suppose, these programs can be found via PATH).
Running txt2html (or PMtxt2html) with keys:
/n - for Netscape, /e - for WebExplorer, allows you to
see the result.
If you want to change parameters of created tags,
put file txt2html.ini at the same place as txt2html.exe,
and edit it.
2.4. For experienced users
txt2html can be used for converting files with special structure.
To use this possibility, run txt2html with keys:
/m - for converting of the set of E-mails and
/s - for converting of list of files.
Key /s - is only for special type of initial documents.
the rest part of a string with URL will be converted to anchor:
string:
hobbes.nmsu.edu is OS/2 site
will be converted (without /s key) to
<a href="http://hobbes.nmsu.edu">hobbes.nmsu.edu</a> is OS/2 site
and with key /s
<a href="http://hobbes.nmsu.edu">is OS/2 site</a>
Key /m is used for converting all files (looking like E-mails)
in a current directory.
This mode is usefull if you subscribe to any mailing service
and want create HTML files from received post.
You can run txt2html on your WWW server. To do this, download
CGI script gatetxt2html from http://wgc.chem.pu.ru/personal/valera/mypub/
This script allows a user to put a text into a window in the form
and to obtain HTML reply. You may find the example of such service
at: http://wgc.chem.pu.ru/common/gatetxt2html.html
3. How to convert a text.
Usage: txt2html filename [filename.html] [/e|n] [/m] [/s]
The result will be placed to filename.html
Txt2HTML assumes the 'natural' markup of ASCII text:
paragraphs are separated by empty line,
list's items start with sign '-' or digits,
headers are short and separated from other text,
'preformatted' text contains a lot of spaces and tabs.
So, usually you don't need make something special with your
ASCII text.
Txt2html tries to recognize URL-like words, so URL in a phrase
"look at www.w3.org." will be dressed by anchor (note,
without extra "."), but "www. " will not. So, you can include
a reference to an URL or an image by typing in the text
something like this:
Look at images/cool.jpg and mail to Mickey@disney.inc.com!
You can automatically start Netscape or WebExplorer to preview
created file by adding key /n or /e.
Of course, after txt2html you'll get a ROUGH HTML text. Use any kind
of editor to improve it!
4. What txt2html really does ? :)
(I try to summarize features of txt2html in an example,
look at test.txt, so you may run 'txt2html test.txt'
and look at test.html!)
otherwise read text below:
So, txt2html:
- analyzes input file to separate strings by categories:
-empty string
-line string with -_=*+ signs
-string with tabs or big spaces
-string starting with -[ chars
-string starting with number
-short string
- this information using bugs-full algorithm converts
to some format information:
-skiping extra empty lines
-organizing definition lists
-preformatting of some texts with holes
-strings with columns
-heading
- txt2html writes HTML header. First string (or it's beginning)
is considered as a title. Some simple META information is
included.
- special characters <>"& is substituted according to HTML
notation
- if 850 code page is active, special characters are converted
to &xxx;
- some formatting tags (see above) are included into output.
- some URL-like words are substituted by anchors:
"http:","ftp:","mailto:","telnet:","gopher:",
"@","www.","archie.",".mil","ftp.",".net",".gov",
".org",".com",".edu",".htm",".html",".shtml".
So phrase "visit ftp.sunet.se, hobbes.nmsu.edu or
look at mirror.html." will be converted to:
"visit <A HREF="ftp://ftp.sunet.se">ftp.sunet.se</A>,
<A HREF="http://hobbes.nmsu.edu">hobbes.nmsu.edu</A> or
look at <A HREF="mirror.html">mirror.html</A>."
Characters (space,!;()<?\n\t and ending .) are considered
as separators between words.
- image-like words (with .jpg, .gif) covered by IMG
tags. If real files are exist WIDTH and HEIGHT attributes
are added automatically.
5. LICENSE AGREEMENT.
Txt2HTML is provided without ANY kind of warranty, and you can use it
without any limitation at your own risk.
You may NOT use this software as a part of a commercial
product, also if you work in military or defense organization
or live in a communist oriented country such as Cuba, North Korea,
Yugoslavia, Belorussia, Libia etc. Guys, you have more important
dial before using my favourite software!
If you disagree with this policy, destroy txt2html.exe now.
Txt2HTML is freeware.
6. History
1.5 (19.09.98)
*
* PM front end.
* improved structure of HTML file
* Tables! (converted from preformatted text with columns)
* customization of tag parameters
* different work with <ul> and <dl>
* HR width and size
* META Keywords
* work also with FAT disks
1.4 (10.07.98)
*
* 850 code page support. if 850 codepage is active one you can
convert paneuropean characters.
* automatically run Netscape or WebExplorer for preview.
* mail mode (create HTML's from a group of E-mail files)
* some bugs in URL determination have fixed
* second parameter is considered as output_file_name
1.3 (09.02.98)
*
* some small bugs were corrected
* new key /s - smart mode for anchors: use the rest of line as anchor.
* gate mode: you can install txt2html with CGI gate.
1.2 (25.12.97)
*
* new algorithm for format recognizing
* image tags with attributes
1.1 (01.10.97)
*
* definition lists
* more accurate work with URLs
1.0 (01.07.1997)
*
* first release
7. Author.
New version of the program you may find at
http://wgc.chem.pu.ru/personal/valera/mypub/
Any comments, bugs, suggestions send to Valera Veryazov :
valera@wgc.chem.pu.ru