HTML txt Manual: Difference between revisions
No edit summary |
|||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
''By [[Daniel Hellerstein]]'' | ''By [[Daniel Hellerstein]]'' | ||
=HTML_TXT: An HTML to Text Converter= | ==HTML_TXT: An HTML to Text Converter== | ||
===Introduction=== | |||
==Introduction== | |||
'''HTML_TXT''', version 1.10, is used to convert an ''HTML'' file to a <tt>text</tt> file. '''HTML_TXT''' is written in REXX and is meant to be run under OS/2. However, it also runs under other REXX interpreters, such as Regina REXX for DOS and Regina REXX for WIN95. | '''HTML_TXT''', version 1.10, is used to convert an ''HTML'' file to a <tt>text</tt> file. '''HTML_TXT''' is written in REXX and is meant to be run under OS/2. However, it also runs under other REXX interpreters, such as Regina REXX for DOS and Regina REXX for WIN95. | ||
| Line 15: | Line 14: | ||
* change characters used to signify logical elements (emphasis, anchors, list bullets, etc.) | * change characters used to signify logical elements (emphasis, anchors, list bullets, etc.) | ||
==Installling and Executing HTML_TXT== | ===Installling and Executing HTML_TXT=== | ||
'''HTML_TXT''' is easy to install and run: | '''HTML_TXT''' is easy to install and run: | ||
# Copy HTML_TXT.CMD to a directory. | # Copy HTML_TXT.CMD to a directory. | ||
# Open up an OS/2 prompt, change to the directory containing <tt>HTML_TXT.CMD</tt>, and type <code>HTML_TXT</code> at the command prompt. | # Open up an OS/2 prompt, change to the directory containing <tt>HTML_TXT.CMD</tt>, and type <code>HTML_TXT</code> at the command prompt. | ||
# Follow the instructions. | # Follow the instructions. | ||
''No other libraries or support files are needed.'' | ''No other libraries or support files are needed.'' | ||
| Line 32: | Line 30: | ||
<tt>file.txt</tt> is the output file (a text document) | <tt>file.txt</tt> is the output file (a text document) | ||
<tt>/VAR var1=val1 ; var2=val2</tt> is an '''optional''' list of parameters to modify. | <tt>/VAR var1=val1 ; var2=val2</tt> is an '''optional''' list of parameters to modify. | ||
''Example:'' | ''Example:'' | ||
D:\HTMLTXT HTML_TXT foo.htm foo.txt /VAR lineart=0 ; lagul=* $ | D:\HTMLTXT HTML_TXT foo.htm foo.txt /VAR lineart=0 ; lagul=* $ | ||
'''Alternatively''', you can run HTML_TXT from an (OS/2) prompt without any arguments; you will then be asked for an input and output file, and will be permitted to change the values of several of the more important parameters. | '''Alternatively''', you can run HTML_TXT from an (OS/2) prompt without any arguments; you will then be asked for an input and output file, and will be permitted to change the values of several of the more important parameters. | ||
==Features== | ===Features=== | ||
HTML_TXT attempts to support many HTML options; including nested tables, nested lists, centering, and recognition of FORM elements. | HTML_TXT attempts to support many HTML options; including nested tables, nested lists, centering, and recognition of FORM elements. | ||
| Line 45: | Line 41: | ||
''This table assumes that you have a basic familiarity with HTML.'' | ''This table assumes that you have a basic familiarity with HTML.'' | ||
{|class="wikitable" | {|class="wikitable" | ||
! | !Type of Feature||Discussion||Customization | ||
|- | |- | ||
!Character Display | !Character Display | ||
| Line 53: | Line 47: | ||
* Capitalization of '''bold''' emphasis | * Capitalization of '''bold''' emphasis | ||
* Underlining of <u>underlined</u> emphasis | * Underlining of <u>underlined</u> emphasis | ||
* "quoting" of ''italic'' and <A>nchor emphasis | * "quoting" of ''italic'' and <nowiki><A>nchor emphasis</nowiki> | ||
* "quoting" of the labels used to identify image elements. Image elements consist of <IMG>s and <AREA>s ''(the ALT attribute, or the source image filename, is used as the label)''. | * "quoting" of the labels used to identify image elements. Image elements consist of <nowiki><IMG>s and <AREA>s</nowiki> ''(the ALT attribute, or the source image filename, is used as the label)''. | ||
| | | | ||
*''DOCAPS'' specifies when to use CAPITALIZATION as an emphasis | *''DOCAPS'' specifies when to use CAPITALIZATION as an emphasis | ||
*''DOULINE'' specifies when to use under_linining as an emphasis. | *''DOULINE'' specifies when to use under_linining as an emphasis. | ||
*''DOQUOTE'' specifies when to use "quotes" as an emphasis '' (suggestion: you might want to add <tt>FONT</tt> to DOQUOTE) ''<br />''QUOTESTRING1 and QUOTESTRING2'' specify the characters to use "as quotes" | *''DOQUOTE'' specifies when to use "quotes" as an emphasis '' (suggestion: you might want to add <tt>FONT</tt> to DOQUOTE) ''<br />''QUOTESTRING1 and QUOTESTRING2'' specify the characters to use "as quotes" | ||
*''PREA and POSTA'' specify the characters used to identify <A>nchors. | *''PREA and POSTA'' specify the characters used to identify <nowiki><A>nchors</nowiki>. | ||
*''PREIMG and POSTIMG'' specify the characters to use as "quotes" around image labels.<br />''IMGSTRING_MAX'' is used to control how to display an image label. | *''PREIMG and POSTIMG'' specify the characters to use as "quotes" around image labels.<br />''IMGSTRING_MAX'' is used to control how to display an image label. | ||
|- | |- | ||
!Lists | !Lists | ||
| | | | ||
<nowiki>HTML_TXT supports nested lists - with successively deeper indentations used to display nested lists. Supported lists include <UL> and <MENU> unordered lists, <OL> ordered lists, <DL> definition lists, and <BLOCKQUOTE> ''both-side indented'' blocks. You can: | <nowiki>HTML_TXT supports nested lists - with successively deeper indentations used to display nested lists. Supported lists include <UL> and <MENU> unordered lists, <OL> ordered lists, <DL> definition lists, and <BLOCKQUOTE></nowiki> ''both-side indented'' blocks. You can: | ||
* Change the bullet styles used in <UL> and <MENU> lists - with different bullets used at different nesting levels. | * Change the bullet styles used in <nowiki><UL> and <MENU> lists - with different bullets used at different nesting levels.</nowiki> | ||
* <nowiki>Change the numbering style used (by default) for <OL> lists. Note that HTML_TXT will use TYPE and START attributes of <OL> lists, and will use the VALUE attribute (if specified) of a <LI>.</nowiki> | * <nowiki>Change the numbering style used (by default) for <OL> lists. Note that HTML_TXT will use TYPE and START attributes of <OL> lists, and will use the VALUE attribute (if specified) of a <LI>.</nowiki> | ||
| | | | ||
| Line 81: | Line 75: | ||
I.a.1) Sub subsection | I.a.1) Sub subsection | ||
I.b)Sub section 2 | I.b)Sub section 2 | ||
In the above example: the <tt>I)</tt> and <tt>I.a)</tt> could be used by HTML_TXT to display an | In the above example: the <tt>I)</tt> and <tt>I.a)</tt> could be used by HTML_TXT to display an H2 and an H3 heading (respectively) | ||
| | | | ||
*''PREH1 and POSTH1'' specify the "quote" character to use for | *''PREH1 and POSTH1'' specify the "quote" character to use for H1 headings, PREHN and POSTHN specify the "quote" character to use for other <Hn> headings (n=2,..,7). | ||
*''HN_OUTLINE'' specifies at what heading level to start the hierarchical index at ''(i.e.; you probably do <u>not</u> want | *''HN_OUTLINE'' specifies at what heading level to start the hierarchical index at ''(i.e.; you probably do <u>not</u> want H1 headings to be the "top level numbers" of an index)'' *HN_NUMBERS.n (n=1,2,.,7) specifies numbering styles to use | ||
|- | |- | ||
!TABLES | !TABLES | ||
| Line 138: | Line 132: | ||
|} | |} | ||
==Changing Parameters== | ===Changing Parameters=== | ||
As noted in the customization column of the above table, HTML_TXT contains a number of user configurable parameters. | As noted in the customization column of the above table, HTML_TXT contains a number of user configurable parameters. | ||
| Line 147: | Line 141: | ||
The following lists the more important parameters. ''Of particular interest are the <tt>NOANSI, LINEART, TABLEMAXNEST, TABLEMODE2</tt> and <tt>TOOLONGWORD</tt> parameters.'' | The following lists the more important parameters. ''Of particular interest are the <tt>NOANSI, LINEART, TABLEMAXNEST, TABLEMODE2</tt> and <tt>TOOLONGWORD</tt> parameters.'' | ||
{|class="wikitable" | {|class="wikitable" | ||
| | |+General Controls | ||
|DOCAPS|| Captialization is used to indicate these "logical and physical" elements | |||
|- | |- | ||
| | |DOULINE|| Spaces are replaced with <u>underscores</u> to indicate these elements | ||
| | |||
|- | |- | ||
| | |DOQUOTE|| "quotes" are used to indidate these elements. | ||
| | |||
|- | |- | ||
| | |DISPLAY_ERRORS|| Set level of error reporting (of html coding errors encountered) | ||
| | |||
|- | |- | ||
| | |FORM_BR|| If enabled a line BReak is added after the end of every FORM | ||
| | |||
|- | |- | ||
| | |HN_OUTLINE|| Create a hierarchical outline from '''<Hn>''' elements | ||
| | |||
|- | |- | ||
| | |IMGSTRING_MAX|| Controls how <IMG> labels are displayed. For example, you can display the ALT attribute, a [], a reference to a list (at the bottom of the document), or you can display nothing (so that the text document ignores all IMG elements) | ||
| | |||
|- | |- | ||
| | |IGNORE_WIDTH|| Ignore WIDTH option in <nowiki><TD> elements (and/or suppress auto-sizing)</nowiki> | ||
| | |||
|- | |- | ||
| | |'''LINEART'''|| Suppress use of high ascii (non keyboard) characters. | ||
| | |||
|- | |- | ||
| ''' | |'''LINK_DISPLAY'''|| controls whether or not URL information should be displayed (when displaying links). You can suppress display of URL info, display a number into a reference list (that will be written to the end of the text output file), or include the URL in the body of the text. | ||
| | |||
|- | |- | ||
| ''' | |'''NOANSI'''|| Suppress use of ANSI screen controls. | ||
| controls | |||
|- | |- | ||
| | |SHOWALLOPTS|| display all OPTIONS in a SELECT list. | ||
| | |||
|- | |- | ||
| | |SUPPRESS_BLANKLINES|| Suppress display of consecutive blank lines | ||
| display | |||
|- | |- | ||
|'''TOOLONG WORD'''|| trim long strings. | |||
| '''TOOLONG WORD''' | |||
| trim long strings. | |||
|} | |} | ||
Display of tables, in a tabular format, can be tricky. In particular, nested tables may tax the resources of your 80 character text display. HTML_TXT allows you to modify table specific display options, and convert tables into lists. | {|class="wikitable" | ||
|+Table Controls | |||
|colspan=2|Display of tables, in a tabular format, can be tricky. In particular, nested tables may tax the resources of your 80 character text display. HTML_TXT allows you to modify table specific display options, and convert tables into lists. | |||
|- | |- | ||
| | |SUPPRESS_EMPTY_TABLE|| suppress display of empty rows and empty tables | ||
| suppress display of empty rows and empty tables | |||
|- | |- | ||
| TABLEMODE | |TABLEMODE|| Suppress "tabular" display of tables (use lists instead) | ||
| Suppress "tabular" display of tables (use lists instead) | |||
|- | |- | ||
| '''TABLEMODE2''' | |'''TABLEMODE2'''|| Suppress tabular display of ''nested '' tables | ||
| Suppress tabular display of ''nested '' tables | |||
|- | |- | ||
| '''TD_ADD''' | |'''TD_ADD'''|| Used to increase minimum cell widths (useful if narrow cells are clipping short words) | ||
| Used to increase minimum cell widths (useful if narrow cells are clipping short words) | |||
|- | |- | ||
| TABLEBORDER | |TABLEBORDER|| type of default table borders | ||
| type of default table borders | |||
|} | |} | ||
{|class="wikitable" | |||
|+Display Controls | |||
|colspan=2|Since it's '''not''' possible to use ''italics'', '''bold''', font styles, and other such visual aids in a text file, HTML_TXT uses a few tricks instead. | |||
* Capitalization can be used - by default, '''Bold''', '''STRONG''' and <tt>TypewriTer</tt> emphasis is indicated with capitalization. | * Capitalization can be used - by default, '''Bold''', '''STRONG''' and <tt>TypewriTer</tt> emphasis is indicated with capitalization. | ||
* Spaces can be replaced with underscores - this is used to indicate <u>Underline emphasis</u> | * Spaces can be replaced with underscores - this is used to indicate <u>Underline emphasis</u> | ||
| Line 226: | Line 195: | ||
''EM and I emphasis'', anchors, submit fields, and < src="xxx" alt="in-line images"> in-line images are indicated with unique sets of "quote strings". | ''EM and I emphasis'', anchors, submit fields, and < src="xxx" alt="in-line images"> in-line images are indicated with unique sets of "quote strings". | ||
|- | |- | ||
|CHECKBOX and <br /> CHECKBOXCHECK|| Character used as a CHECKBOX button, and a ''selected'' CHECKBOX button | |||
| CHECKBOX and <br /> CHECKBOXCHECK | |||
| Character used as a CHECKBOX button, and a ''selected'' CHECKBOX button | |||
|- | |- | ||
| FLAGMENU | |FLAGMENU|| bullets used in <MENU> lists. | ||
| bullets used in <MENU> lists. | |||
|- | |- | ||
| FLAGUL | |FLAGUL|| bullets used in <UL> lists. | ||
| bullets used in <UL> lists. | |||
|- | |- | ||
| FLAGSELECT and <br />FLAGSELECT2 | |FLAGSELECT and <br />FLAGSELECT2|| character used to signify OPTION and a ''selected'' OPITON (in a SELECT list), respectively | ||
| character used to signify OPTION and a ''selected'' OPITON (in a SELECT list), respectively | |||
|- | |- | ||
| HN_NUMBERS.n <br />''(n=1,2,..,7)'' | |HN_NUMBERS.n <br />''(n=1,2,..,7)''|| characters to use when outlining '''<Hn>''' headings | ||
| characters to use when outlining '''<Hn>''' headings | |||
|- | |- | ||
| HRBIG | |HRBIG|| character used to make large <HR> bars. | ||
| character used to make large <HR> bars. | |||
|- | |- | ||
| OL_NUMBERS | |OL_NUMBERS|| Characters (i.e.; roman numerals, numbers, or letters) as bullets in <OL> (ordered lists) | ||
| Characters (i.e.; roman numerals, numbers, or letters) as bullets in <OL> (ordered lists) | |||
|- | |- | ||
| PRETITLE and <br />POSTTITLE | |PRETITLE and <br />POSTTITLE|| Strings used before and after the doucment '''title''' | ||
| Strings used before and after the doucment '''title''' | |||
|- | |- | ||
| PREA and <br /> POSTA | |PREA and <br /> POSTA|| characters used before and after <A> '''anchors''' | ||
| characters used before and after <A> '''anchors''' | |||
|- | |- | ||
| PREH1 and | |PREH1 and POSTH1|| characters used before and after <nowiki><H1></nowiki> '''headings''' | ||
| characters used before and after <H1> '''headings''' | |||
|- | |- | ||
| PREHN and <br /> POSTHN | |PREHN and <br /> POSTHN|| characters used before and after <Hn1> (n>1) '''headings''' | ||
| characters used before and after <Hn1> (n>1) '''headings''' | |||
|- | |- | ||
| PREIMG and <br /> POSTIMG | |PREIMG and <br /> POSTIMG|| characters used before and after <IMGgt; '''names of in-line images''' | ||
| characters used before and after <IMGgt; '''names of in-line images''' | |||
|- | |- | ||
| QUOTESTRING1 and <br /> QUOTESTRING2 | |QUOTESTRING1 and <br /> QUOTESTRING2|| characters used to ''quote '' emphasize | ||
| characters used to ''quote '' emphasize | |||
|- | |- | ||
| RADIOBOX and <br /> RADIOBOXCHECK | |RADIOBOX and <br /> RADIOBOXCHECK|| Character used as a RADIO button, and a ''selected'' RADIO button | ||
| Character used as a RADIO button, and a ''selected'' RADIO button | |||
|- | |- | ||
| SUBMITMARK1 and <br />SUBMITMARK2 | |SUBMITMARK1 and <br />SUBMITMARK2|| characters used before and after a <SUBMIT> and <RESET> field | ||
| characters used before and after a <SUBMIT> and <RESET> field | |||
|- | |- | ||
| TEXTMARK1, TEXTMARK2, <br /> and TEXTMARK | |TEXTMARK1, TEXTMARK2, <br /> and TEXTMARK|| characters to use on the left, right, and middle of a FILE and TEXT field. | ||
| characters to use on the left, right, and middle of a FILE and TEXT field. | |||
|- | |- | ||
| TABLEVERT and <br /> TABLEHORIZ | |TABLEVERT and <br /> TABLEHORIZ|| characters to use as vertical, and horizontal, lines in tables (used only when lineart is suppressed) | ||
| characters to use as vertical, and horizontal, lines in tables (used only when lineart is suppressed) | |||
|- | |- | ||
| TABLEFILLER | |TABLEFILLER|| character to used to fill empty spaces in tables and textbox's | ||
| character to used to fill empty spaces in tables and textbox's | |||
|} | |} | ||
''For detailed descriptions of these parameters, see HTML_TXT.CMD.'' | ''For detailed descriptions of these parameters, see HTML_TXT.CMD.'' | ||
==Troubleshooting HTML_TXT== | ===Troubleshooting HTML_TXT=== | ||
The following lists possible troubles you might have, and suggested solutions. | The following lists possible troubles you might have, and suggested solutions. | ||
;HTML_TXT display all kinds of weird garbage (such as $ and [ characters) | |||
; | |||
: You don't have ANSI support installed. You should either install ANSI.SYS (for example, include a DEVICE=C:\OS2\MDOS\ANSI.SYS in your OS/2 CONFIG.SYS file), or set NOANSI=1 (in HTML_TXT.CMD). | : You don't have ANSI support installed. You should either install ANSI.SYS (for example, include a DEVICE=C:\OS2\MDOS\ANSI.SYS in your OS/2 CONFIG.SYS file), or set NOANSI=1 (in HTML_TXT.CMD). | ||
; | ;Nested tables aren't displaying properly (this is especially likely to happen when running under Regina REXX for DOS). | ||
: You can try using lists instead of tables | : You can try using lists instead of tables - set TABLEMAXNEST=0 (in HTML_TXT.CMD). | ||
; | ;Tables have unappealing characters used as vertical and horizontal lines | ||
: Either your output device (say, your printer) does not support high-ascii characters, or your code page is somewhat unusual. You can use standard characters (- and !) for line borders by setting LINEART=0 (in HTML_TXT.CMD).. | : Either your output device (say, your printer) does not support high-ascii characters, or your code page is somewhat unusual. You can use standard characters (- and !) for line borders by setting LINEART=0 (in HTML_TXT.CMD).. | ||
; | ;Unappealing characters are being used as bullets and to "quote" text strings | ||
: This can also occur if your code page is somewhat unusual. You can either change the various "display control parameters" (in HTML_TXT.CMD), or you can set LINEART=-1; in which case some default, standard | : This can also occur if your code page is somewhat unusual. You can either change the various "display control parameters" (in HTML_TXT.CMD), or you can set LINEART=-1; in which case some default, standard characters (such as * and @ for bullets) will be used. | ||
; | ;Long words (such as URLs) are being lost. | ||
: You can change the "trimming" action to "word wrap", or to "extend beyond margins", by setting the TOOLONGWORD parameter. | : You can change the "trimming" action to "word wrap", or to "extend beyond margins", by setting the TOOLONGWORD parameter. | ||
; | ;The display of headings is not informative: You can set HN_OUTLINE=2, heading will then be displayed in an "outline format". You can even change the numbering style (say, 2.a.ii versus II.2.b) by changing the HN_NUMBERS.n parameters. | ||
: You can set HN_OUTLINE=2, heading will then be displayed in an "outline format". You can even change the numbering style (say, 2.a.ii versus II.2.b) by changing the HN_NUMBERS.n parameters. | |||
==Disclaimer and Contact Information== | ===Disclaimer and Contact Information=== | ||
;Disclaimer | |||
This is freeware that is to be used at your own risk - the author and any potentially affiliated institutions disclaim all responsibilties for any consequence arising from the use, misuse, or abuse of this software. You may use this, or subsets of this program, as you see fit, including for commercial purposes; so long as proper attribution is made, and so long as such use does not preclude others from making similar use of this code. | This is freeware that is to be used at your own risk - the author and any potentially affiliated institutions disclaim all responsibilties for any consequence arising from the use, misuse, or abuse of this software. You may use this, or subsets of this program, as you see fit, including for commercial purposes; so long as proper attribution is made, and so long as such use does not preclude others from making similar use of this code. | ||
;Contact Information | |||
Do you have the http://www.srehttp.org/apps/html_txt/ latest version of HTML_TXT? | Do you have the http://www.srehttp.org/apps/html_txt/ latest version of HTML_TXT? | ||
If you find errors in this program, would like to make suggestions, or otherwise wish to commment... please contact [mailto:danielh@econ.ag.gov Daniel Hellerstein] | If you find errors in this program, would like to make suggestions, or otherwise wish to commment... please contact [mailto:danielh@econ.ag.gov Daniel Hellerstein] | ||
[[Category: | [[Category:Software Documentation]] | ||
Latest revision as of 22:18, 3 October 2023
HTML_TXT: An HTML to Text Converter
Introduction
HTML_TXT, version 1.10, is used to convert an HTML file to a text file. HTML_TXT is written in REXX and is meant to be run under OS/2. However, it also runs under other REXX interpreters, such as Regina REXX for DOS and Regina REXX for WIN95.
HTML_TXT will attempt to maintain the format of the HTML document by using appropriate spacing and ASCII characters. HTML_TXT can use ASCII art (lines and boxes), as well as other high-ascii characters, to improve the appearance of the output (text) file.
HTML_TXT can be customized in a number of ways. For example, you can:
- suppress the use of line art and other high ASCII characters (your output will be rougher, but will suffer from fewer compatability problems).
- display tables (including nested tables) in a tabular format with auto-sized columns
- change the bullet characters used in ordered lists
- display <Hn> headings as an hierarchical outline
- change characters used to signify logical elements (emphasis, anchors, list bullets, etc.)
Installling and Executing HTML_TXT
HTML_TXT is easy to install and run:
- Copy HTML_TXT.CMD to a directory.
- Open up an OS/2 prompt, change to the directory containing HTML_TXT.CMD, and type
HTML_TXTat the command prompt. - Follow the instructions.
No other libraries or support files are needed.
The READ.ME file describes how to install HTML_TXT if you are a Regina REXX user.
Running from the command line
You can also run HTML_TXT from the command line. The syntax is (where x:\HTMLTXT is the directory containing HTML_TXT.CMD):
x:\HTMLTXT>HTML_TXT file.htm file.txt /var var1=val1 ; var2=val2
where:
file.htm is the input file (an HTML document) file.txt is the output file (a text document) /VAR var1=val1 ; var2=val2 is an optional list of parameters to modify.
Example:
D:\HTMLTXT HTML_TXT foo.htm foo.txt /VAR lineart=0 ; lagul=* $
Alternatively, you can run HTML_TXT from an (OS/2) prompt without any arguments; you will then be asked for an input and output file, and will be permitted to change the values of several of the more important parameters.
Features
HTML_TXT attempts to support many HTML options; including nested tables, nested lists, centering, and recognition of FORM elements.
The following summarizes HTML_TXT's capabilities.
This table assumes that you have a basic familiarity with HTML.
| Type of Feature | Discussion | Customization |
|---|---|---|
| Character Display | HTML_TXT uses a few tricks to identify where emphasis (italics, bold, etc.) are used in an HTML document. These include:
|
|
| Lists |
HTML_TXT supports nested lists - with successively deeper indentations used to display nested lists. Supported lists include <UL> and <MENU> unordered lists, <OL> ordered lists, <DL> definition lists, and <BLOCKQUOTE> both-side indented blocks. You can:
|
FLAGUL and FLAGMENU specifies the bullets to use in <UL> and <MENU> (unordered) lists ''OL_NUMBERS'' specifies the "numbers" to use in an <OL> (ordered) list. |
| Headings |
HTML_TXT supports two methods of displaying <Hn> headings (where n=1,2,..,7).
A hierarchical outline refers to headers that identify a section. For example: I)Main section
I.a)Subsection
I.a.1) Sub subsection
I.b)Sub section 2
In the above example: the I) and I.a) could be used by HTML_TXT to display an H2 and an H3 heading (respectively) |
|
| TABLES |
HTML_TXT supports tabluar display of nested tables. Many (but not all) <TABLE> attributes are supported, including:
Alternatively, HTML_TXT can display tables (or highly nested tables) as nested lists. |
IGNORE_WIDTH can be used to suppress use of WIDTH attributes, and to suppress auto-sizing of columns. TABLE_BORDER can be used to write a table border by default; it can also be used to override a no border (a BORDER=0) attribute NOSPAN can be used to suppress COLSPAN and ROWSPAN options. SUPPRESS_EMPTY_TABLE can be used to enable, or suppress, the display of tables rows. TABLEMODE, TABLEMODE2, and TABLEMAXNEST can be used to control when (if ever) to convert tables to lists. TABLEFILLER can be used to fill blank spaces in a table with something other then a space (say, with a white box). TD_ADD can be used to adjust minimum cell widths TABLEVERT and TABLEHORIZ can be used to specify characters to use when drawing horizontal and vertical borders. These are only used if high ascii characters are suppressed (using LINEART); otherwise, ascii line-art characters are used to draw table borders. |
| FORMS |
HTML_TXT displays FORM elements using several tricks, including:
|
|
| MISCELLANEOUS |
| |
Changing Parameters
As noted in the customization column of the above table, HTML_TXT contains a number of user configurable parameters.
Although the default values of these parameters work well in most cases, you can change them by editing HTML_TXT.CMD with your favorite text editor (look for the "user configurable parameters" section)
Alternatively, you can temporarily changes values using the /VAR command line option. In fact, by specifying a PLIST=file.ext (in the /VAR section), you can create custom instructions for sets of HTML documents.
The following lists the more important parameters. Of particular interest are the NOANSI, LINEART, TABLEMAXNEST, TABLEMODE2 and TOOLONGWORD parameters.
| DOCAPS | Captialization is used to indicate these "logical and physical" elements |
| DOULINE | Spaces are replaced with underscores to indicate these elements |
| DOQUOTE | "quotes" are used to indidate these elements. |
| DISPLAY_ERRORS | Set level of error reporting (of html coding errors encountered) |
| FORM_BR | If enabled a line BReak is added after the end of every FORM |
| HN_OUTLINE | Create a hierarchical outline from <Hn> elements |
| IMGSTRING_MAX | Controls how <IMG> labels are displayed. For example, you can display the ALT attribute, a [], a reference to a list (at the bottom of the document), or you can display nothing (so that the text document ignores all IMG elements) |
| IGNORE_WIDTH | Ignore WIDTH option in <TD> elements (and/or suppress auto-sizing) |
| LINEART | Suppress use of high ascii (non keyboard) characters. |
| LINK_DISPLAY | controls whether or not URL information should be displayed (when displaying links). You can suppress display of URL info, display a number into a reference list (that will be written to the end of the text output file), or include the URL in the body of the text. |
| NOANSI | Suppress use of ANSI screen controls. |
| SHOWALLOPTS | display all OPTIONS in a SELECT list. |
| SUPPRESS_BLANKLINES | Suppress display of consecutive blank lines |
| TOOLONG WORD | trim long strings. |
| Display of tables, in a tabular format, can be tricky. In particular, nested tables may tax the resources of your 80 character text display. HTML_TXT allows you to modify table specific display options, and convert tables into lists. | |
| SUPPRESS_EMPTY_TABLE | suppress display of empty rows and empty tables |
| TABLEMODE | Suppress "tabular" display of tables (use lists instead) |
| TABLEMODE2 | Suppress tabular display of nested tables |
| TD_ADD | Used to increase minimum cell widths (useful if narrow cells are clipping short words) |
| TABLEBORDER | type of default table borders |
Since it's not possible to use italics, bold, font styles, and other such visual aids in a text file, HTML_TXT uses a few tricks instead.
The last trick, the use of "quote strings", is frequently used by HTML_TXT; with different sets of quote strings used for different emphasis. For example, EM and I emphasis, anchors, submit fields, and < src="xxx" alt="in-line images"> in-line images are indicated with unique sets of "quote strings". | |
| CHECKBOX and CHECKBOXCHECK |
Character used as a CHECKBOX button, and a selected CHECKBOX button |
| FLAGMENU | bullets used in <MENU> lists. |
| FLAGUL | bullets used in
|
| FLAGSELECT and FLAGSELECT2 |
character used to signify OPTION and a selected OPITON (in a SELECT list), respectively |
| HN_NUMBERS.n (n=1,2,..,7) |
characters to use when outlining <Hn> headings |
| HRBIG | character used to make large bars. |
| OL_NUMBERS | Characters (i.e.; roman numerals, numbers, or letters) as bullets in
|
| PRETITLE and POSTTITLE |
Strings used before and after the doucment title |
| PREA and POSTA |
characters used before and after <A> anchors |
| PREH1 and POSTH1 | characters used before and after <H1> headings |
| PREHN and POSTHN |
characters used before and after <Hn1> (n>1) headings |
| PREIMG and POSTIMG |
characters used before and after <IMGgt; names of in-line images |
| QUOTESTRING1 and QUOTESTRING2 |
characters used to quote emphasize |
| RADIOBOX and RADIOBOXCHECK |
Character used as a RADIO button, and a selected RADIO button |
| SUBMITMARK1 and SUBMITMARK2 |
characters used before and after a <SUBMIT> and <RESET> field |
| TEXTMARK1, TEXTMARK2, and TEXTMARK |
characters to use on the left, right, and middle of a FILE and TEXT field. |
| TABLEVERT and TABLEHORIZ |
characters to use as vertical, and horizontal, lines in tables (used only when lineart is suppressed) |
| TABLEFILLER | character to used to fill empty spaces in tables and textbox's |
For detailed descriptions of these parameters, see HTML_TXT.CMD.
Troubleshooting HTML_TXT
The following lists possible troubles you might have, and suggested solutions.
- HTML_TXT display all kinds of weird garbage (such as $ and [ characters)
- You don't have ANSI support installed. You should either install ANSI.SYS (for example, include a DEVICE=C:\OS2\MDOS\ANSI.SYS in your OS/2 CONFIG.SYS file), or set NOANSI=1 (in HTML_TXT.CMD).
- Nested tables aren't displaying properly (this is especially likely to happen when running under Regina REXX for DOS).
- You can try using lists instead of tables - set TABLEMAXNEST=0 (in HTML_TXT.CMD).
- Tables have unappealing characters used as vertical and horizontal lines
- Either your output device (say, your printer) does not support high-ascii characters, or your code page is somewhat unusual. You can use standard characters (- and !) for line borders by setting LINEART=0 (in HTML_TXT.CMD)..
- Unappealing characters are being used as bullets and to "quote" text strings
- This can also occur if your code page is somewhat unusual. You can either change the various "display control parameters" (in HTML_TXT.CMD), or you can set LINEART=-1; in which case some default, standard characters (such as * and @ for bullets) will be used.
- Long words (such as URLs) are being lost.
- You can change the "trimming" action to "word wrap", or to "extend beyond margins", by setting the TOOLONGWORD parameter.
- The display of headings is not informative
- You can set HN_OUTLINE=2, heading will then be displayed in an "outline format". You can even change the numbering style (say, 2.a.ii versus II.2.b) by changing the HN_NUMBERS.n parameters.
Disclaimer and Contact Information
- Disclaimer
This is freeware that is to be used at your own risk - the author and any potentially affiliated institutions disclaim all responsibilties for any consequence arising from the use, misuse, or abuse of this software. You may use this, or subsets of this program, as you see fit, including for commercial purposes; so long as proper attribution is made, and so long as such use does not preclude others from making similar use of this code.
- Contact Information
Do you have the http://www.srehttp.org/apps/html_txt/ latest version of HTML_TXT?
If you find errors in this program, would like to make suggestions, or otherwise wish to commment... please contact Daniel Hellerstein