home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / htmstrip.zip / HTMSTRIP.DOC < prev    next >
Text File  |  1998-11-27  |  60KB  |  1,271 lines

  1. HTMSTRIP.DOC                         1                         Nov 19, 1998
  2.  
  3. WIN95 AND WINNT NOTICE:  As with most  DOS-based  utilities,  this  program
  4. doesn't  understand  the  weird  subdirectories,  long  filenames,  invalid
  5. characters that  are  possible  under  Windows  95  and  Windows/NT.   Both
  6. operating systems alias long filenames into names like MYFILE~1.TXT and you
  7. will need to specify the aliased versions of file names to process them. If
  8. you're not sure what the pseudo-name is, use the "DIR /X" command in DOS to
  9. check.  Under some file structure systems in NT, the program may  not  work
  10. at all.
  11.  
  12. The HTMSTRIP.EXE program attempts to  read  HTML  pages,  remove  the  HTML
  13. coding, and write the file out as something more useful.  Features of  this
  14. program:
  15.  
  16.   * Ideal way to prep HTML documents for later  retransmission  via  e-mail
  17.     (which doesn't support the fonts, pictures, etc).  Beats out Netscape's
  18.     Save As Text option hands down.
  19.   * Can be run across an entire  subdirectory  (for  example,  your  entire
  20.     cache subdirectory), and will only process the HTML documents  that  it
  21.     finds. (There are some options on this.)
  22.   * Removes all embedded HTML commands.
  23.   * Recodes the standard HTML  "entity  references"  (so  "©"  becomes
  24.     "(c)"). The actual replacements are coded in a  user-modifiable  lookup
  25.     file.
  26.   * Handles standard indent, heading, selection groups, menus, tables, etc.
  27.   * Supports most  of  what's  in  the  HTML  3.2  specification  and  some
  28.     additional 4.0 features.
  29.   * Reflows all text as appropriate.
  30.   * Can provide character-translation table to filter out  characters  that
  31.     only work under Windows.
  32.   * Can indicate bolding, underlining, etc with user-specified characters.
  33.   * Optionally,  will  replace  Link,  Image,  and  Input  references  with
  34.     user-definable text representations.
  35.   * Optionally, alerts you to possible errors in the HTML code itself.
  36.   * Supports ISO 8859/1 8-bit single-byte (Windows), 7-bit DOS  ASCII,  and
  37.     8-bit DOS ASCII character sets.
  38.   * Optionally creates a logfile of file activity.
  39.   * Pressing escape stops the program early.
  40.  
  41. HTML  codes  are  surrounded   within   <...>   indicators.    For   upward
  42. compatibility reasons, Web  browsers  ignore  any  codes  that  they  don't
  43. understand and just process the ones they can handle.
  44.  
  45. HTMSTRIP removes all HTML codes.  It also handles the standard HTML "&xxx;"
  46. "entity references" (for example, "©" is replaced by "(c)").  You  can
  47. add or  change  these  replacements  as  desired  by  using  the  INI  file
  48. (documented later).
  49.  
  50.  
  51. Quickie instructions:
  52.  
  53. Okay!  You hate to read.  I know that.  And there aren't any cute  pictures
  54. in this documentation and, like everything I write, it's way  too  long  to
  55. keep your attention for  long.   So,  let's  bottom  line  it;  what's  the
  56. quickest way to use this program without learning any of the options?
  57.  
  58.  
  59. HTMSTRIP.DOC                         2                         Nov 19, 1998
  60.  
  61. Let's presume you're running under  Windows.   Take  the  HTMSTRIP.EXE  and
  62. HTMSTRIP.INI files from the HTMSTymm.ZIP file and copy  them  to  the  same
  63. subdirectory somewhere.  (They should be in the same  subdirectory  already
  64. since that's how uncompressing them would  have  gone.)  This  subdirectory
  65. should be in your path.  If you're not sure what your path is, hop  to  DOS
  66. and type "SET".  There should be a line  shown  that  says  something  like
  67. "PATH=C:\;C:\DOS;C:\WINDOWS".  I wouldn't advise copying  HTMSTRIP.EXE  and
  68. HTMSTRIP.INI to your WINDOWS subdirectory.  Maybe your root?
  69.  
  70. Get on the Web and save the source of an HTML document to your  hard  disk.
  71. This is done from the Netscape Navigator by bringing up a page  and  saying
  72. "Save As...".  Remember the file name and what subdirectory you  saved  the
  73. document to.   Just  for  example's  sake,  let's  say  the  file  name  is
  74. "UPEPIS.HTM".
  75.  
  76. Hop to DOS.  (You can run HTMSTRIP from the Run option in Windows but  it's
  77. easier to explain this  way.)  Make  the  directory  where  you  saved  the
  78. document your default subdirectory.  (This is usually done with a series of
  79. "CD" commands in DOS.)
  80.  
  81. Now, type:
  82.  
  83.         HTMSTRIP
  84.  
  85. You didn't pass in any parameters so HTMSTRIP will request the name of  the
  86. file to process.  Enter the name of the HTML file.  In our case, this would
  87. appear like:
  88.  
  89.         Enter filespec to process? UPEPIS.HTM
  90.  
  91. Presuming you did everything correctly, the HTMSTRIP program will read  the
  92. HTML file and tell you it created a new file with  the  file  extension  of
  93. ".OUT" (in our case, "UPEPIS.OUT").
  94.  
  95. That was pretty easy.  Now, hop back into Windows and bring the new file up
  96. in your text editor (use Write or something else that uses  TrueType  fonts
  97. instead of NotePad).  With luck, you'll see the file looking similar to how
  98. it did when you were viewing it under your Web browser.  The difference  is
  99. that it's now a properly-formatted text document which fits on  the  screen
  100. and can be e-mailed to someone.
  101.  
  102. Hop back into DOS.  Type "HTMSTRIP /?".  You'll see there are  a  bunch  of
  103. other parameters that you can pass in.  If  you're  not  pleased  with  the
  104. output file that was created, you might want to read  the  quick  on-screen
  105. description of each option and then consult the HTMSTRIP.DOC file for  more
  106. instructions about anything that sounds interesting.   (Since  the  program
  107. doesn't alter the source HTML file, you can keep rerunning the program with
  108. different parameters to see how they affect things.) Chances are, you won't
  109. want to revise any of the system defaults at least initially.  If you  find
  110. yourself consistently needing to change some options,  you  might  want  to
  111. edit the HTMSTRIP.INI  file  to  specify  those  new  defaults.   Read  the
  112. BRUCEINI.DOC file for information on overriding defaults.
  113.  
  114. Note that the instructions tell you you can use  wildcards  for  the  input
  115. file name.  You can do something like "HTMSTRIP *.HTM" and it will  process
  116. every file with an ".HTM" extension in your default subdirectory.
  117.  
  118.  
  119. HTMSTRIP.DOC                         3                         Nov 19, 1998
  120.  
  121. HTML codes:
  122.  
  123. HTMSTRIP is also tuned to allow it  to  specially-handle  several  embedded
  124. HTML codes found through HTML version 3.2.  You can go to http://www.w3.org
  125. to get more information about the HTML  standards.   These  codes  are  the
  126. following:
  127.  
  128.                            HTML codes supported
  129.  
  130.                  Supported
  131. Element          Attributes   Description
  132.  
  133. <!-- ... -->                  Comments (skip)
  134. <A ...>...</A>                External link
  135.                  HREF=site      Start of hypertext link
  136.                  ID=anchor      Establishes target for hypertext links
  137.                  NAME=anchor    Establishes target for hypertext links
  138. <AREA>                        Client-side image hotspot
  139.                  HREF=site      Hypertext link
  140.                  ALT=text       What to display if text-only environment
  141. <B>..</B>                     Bold text
  142. <BASE ...>                    Establishing a root directory
  143.                  HREF=site      Prefix to add to unqualified sites
  144. <BLOCKQUOTE>...</BLOCKQUOTE>  Indented block of text (same as <BQ>...</BQ>)
  145. <BR>                          Forced line break
  146. <CAPTION>...</CAPTION>        Title for a table block
  147. <CENTER>...</CENTER>          Centering text block
  148. <DD>                          Term definition
  149. <DIR>...</DIR>                Directory list of items (obsolete)
  150. <DL>...</DL>                  Definition list block
  151. <DT>                          First term of definition list/glossary
  152. <EM>...</EM>                  Emphasize text
  153. <H1> to <H6>...</H1> to </H6> Heading items
  154. <HR>                          Horizontal rule
  155. <I>..</I>                     Italicize text
  156. <IMG ...>                     Image
  157.                  SRC=site       Location of the image
  158.                  ALT=text       What to display if text-only environment
  159. <INPUT ...>                   User input
  160.                  TYPE=CHECKBOX  Type of input -- shown as [_]
  161.                  TYPE=HIDDEN    Type of input -- suppress
  162.                  TYPE=RADIO     Type of input -- shown as (_)
  163.                  CHECKED        Makes [X] or (X)
  164.                  SIZE=n         Specifies length for input fields
  165.                  VALUE=text     Specifies default value for input fields
  166. <LI>                          Menu/Ordered/Unordered/Directory list item
  167. <MAP>...</MAP>                Client-side image map
  168. <MENU>...</MENU>              Menu listing block (obsolete)
  169. <OL>...</OL>                  Ordered listing block (numbering's skipped)
  170. <OPTION>                      Used for single/multiple choice menus
  171. <P>                           Paragraph indicator
  172. <PRE>...</PRE>                Preserve spacing block (preformatted text)
  173.  
  174. Table Continues...
  175.  
  176. HTMSTRIP.DOC                         4                         Nov 19, 1998
  177.  
  178.                      HTML codes supported (continued)
  179.  
  180.                  Supported
  181. Element          Attributes   Description
  182.  
  183. <SCRIPT>...</SCRIPT>          Java script blocks are ignored
  184. <SELECT>...</SELECT>          Block for single/multiple choice menu
  185.                  MULTIPLE       Allow for multiple selections
  186. <STRONG>..</STRONG>           "Strong" text (HTMSTRIP treats this tag
  187.                               the same as <B>..</B>)
  188. <TABLE>...</TABLE>            Table block
  189. <TD>...</TD>                  Table data (cell)
  190.                  ALIGN=spec     How to align the cell (default is LEFT)
  191.                  COLSPAN=n      How many columns to span with this cell
  192.                  ROWSPAN=n      How many rows to span with this cell
  193. <TH>...</TH>                  Table heading
  194.                  ALIGN=spec     How to align the cell (default is CENTER)
  195.                  COLSPAN=n      How many columns to span with this cell
  196.                  ROWSPAN=n      How many rows to span with this cell
  197. <TITLE>...</TITLE>            Title item
  198. <TR>...</TR>                  Table row
  199. <U>..</U>                     Underlining text
  200. <UL>...</UL>                  Unordered listing
  201.  
  202. If you run across other codes that become vital, let me know and  I'll  see
  203. about handling them somehow.
  204.  
  205.  
  206. How to get HTML files:
  207.  
  208. Some people who are using regular Web  browsers  like  Mosaic  or  Netscape
  209. don't realize that they're automatically saving HTML files  to  their  hard
  210. disk throughout every Web session.  That's because  just  about  every  Web
  211. browser saves the most-recently accessed files from the Web (including HTML
  212. source code, GIF's, and JPG's) on your hard disk and reads them from  there
  213. instead of requiring you to download them every  time  you  go  back  to  a
  214. previous page.  This is typically settable by you under  "Preferences"  and
  215. "Cache" on your Web browser.
  216.  
  217.  
  218. HTMSTRIP.DOC                         5                         Nov 19, 1998
  219.  
  220. I usually set my Web browser to have a huge cache,  maybe  10MB.   Anything
  221. beats downloading the same pages over again even at 28.8K.  And I make sure
  222. that I do not have anything specified like "clear cache at the end of every
  223. session".  Then I just go through  the  files  in  the  cache  subdirectory
  224. afterward and reprocess them.
  225.  
  226. Two disadvantages to a cache...  It takes up hard disk space but, hey,  the
  227. Web browser is typically in Windows so why are you surprised.   The  second
  228. disadvantage is that if the page actually  changes  between  sessions,  you
  229. typically won't notice the new page as long as it remains in your cache. If
  230. you think a page is still in cache and should have been changed but didn't,
  231. you can typically ask your  Web  browser  to  reload  the  page.   On  some
  232. browsers, this is shown as an arrow in the form of a circle.
  233.  
  234. HTMSTRIP can process  the  entire  cache  subdirectory.   It  automatically
  235. detects non-HTML files for you and processes accordingly.  It  creates  new
  236. text file versions of just the HTML pages it finds.
  237.  
  238. Another great way to get HTML pages is to use the URL-minder service at:
  239.  
  240.         http://www.netmind.com
  241.  
  242. This is a free service which automatically tells you whenever a Web  page's
  243. contents changes.  If you use the advanced features, you can have  the  Web
  244. page's HTML code sent to you as a file attachment (it's easier than dealing
  245. with the "embed" option too).  Then you can run HTMSTRIP on  the  resulting
  246. file.
  247.  
  248.  
  249. Specifying parameters:
  250.  
  251. Parameters for this program can be set in the  following  ways.   The  last
  252. setting encountered always wins:
  253.   - Read from an *.INI file (see BRUCEINI.DOC file),
  254.   - Through the use of an environmental variable  (SET  HTMSTRIP=whatever),
  255.     or
  256.   - From the command line (see "Syntax" below)
  257.  
  258. HTMSTRIP also allows you to define:
  259.   - How "entity references" (things like "®") are shown
  260.   - How "symbolic references" (things like "[input]" and "<B>") are shown
  261.   - Which characters should be filtered into other characters (things  like
  262.     showing "Æ" as "'" -- none of these should actually appear on Web pages
  263.     by the way)
  264.  
  265. These are explained in sections at the end of this documentation.
  266.  
  267.  
  268. HTMSTRIP.DOC                         6                         Nov 19, 1998
  269.  
  270. Syntax:
  271.  
  272.     HTMSTRIP [ filespec | (filelist) | @listfile ] [ /Cpath ] [ outfile ]
  273.       [ /EXT=.xxx ] [ /COPY=path ] [ /CREATE ] [ /ALL ] [ /ATTR=attribs ]
  274.       [ /WIDTH=n ] [ /FORCE ] [ /RULE=s ] [ /BORDER=c ] [ /BUFF=n ]
  275.       [ /SPACES ] [ /RSPACE ] [ /WARNINGS ] [ /-TABLE ] [ /-INDENT ]
  276.       [ /CPn ] [ /A=spec ] [ /IMG=spec | /IMGALT=spec ]
  277.       [ /MAP=spec | /MAPALT=spec ] [ /ALTONLY ] [ /HTTP=cc ] [ /-INPUT ]
  278.       [ /Linitfile ] [ /FILTER | /FILTER=filename ]
  279.       [ /LOG=logfile ] [ /T=temp_dir ] [ /MONO ]
  280.       [ /Iinitfile | /-I ] [ /-ENV ] [ /? ] [ /?HEX ]
  281.  
  282. where:
  283.  
  284. "filespec" tells the routine which file or files are to be processed.   The
  285. specification can include path and wildcards if  desired.   Typically,  the
  286. file names are  *.HTM  files.   If  no  input  specification  (filespec  or
  287. @listfile) is provided, you'll be prompted for one.   If  no  extension  is
  288. provided, ".HTM" is presumed.  (If you want to process a  file  which  does
  289. not have an extension, include the trailing period on the file  name,  such
  290. as "HTMSTRIP HTTP_WWW." (with the period in there).
  291.  
  292. "(filelist)" allows you to specify multiple files to be processed from  the
  293. command line.  File names should be separated by spaces.  They may  include
  294. drive, path, and wildcard information.  Remember that a command line in DOS
  295. cannot exceed 127 characters so you're limited as  to  how  many  different
  296. file specifications you can provide in this fashion.
  297.  
  298. "@listfile" allows you to have a variety of file specifications saved in  a
  299. text file named "listfile".  Each line in the file should  consist  of  one
  300. file specification, each of which can  include  a  path  and  wildcards  if
  301. desired.  Blank lines and lines  beginning  with  semi-colons,  colons,  or
  302. quotes are ignored.  If no input specification (filespec or  @listfile)  is
  303. provided, you'll be prompted for one.
  304.  
  305. "/Cpath" specifies that the cache is found in  a  particular  subdirectory.
  306. This allows you to specify a default  location  in  your  *.INI  file  (see
  307. BRUCEINI.DOC) and just specify something like "A*.HTM"  for  the  files  to
  308. process.  Note, however, that if you don't use *.INI files, it's easier  to
  309. just pass in the input file path with the "filespec"  parameter  ("HTMSTRIP
  310. *.HTM /C\CACHE" and "HTMSTRIP \CACHE\*.HTM" are  the  same).   Defaults  to
  311. your current default path.  If the input filespec includes  drive  or  path
  312. information, this will override the /Cpath specification.
  313.  
  314. "outfile" is the name of the output file to create.  Is overwritten without
  315. prompting if it exists already.  If no output file name  is  provided,  the
  316. routine will use the infile  and  provide  an  extension  of  *.OUT.   (The
  317. default .OUT extension can be overridden using the /EXT=.xxx parameter.) An
  318. outfile cannot be specified if wildcards or  @listfile  are  used  for  the
  319. input file specification.
  320.  
  321. "/EXT=.xxx" allows you to specify a different default  file  extension  for
  322. the output file.  This parameter only matters  if  you  do  not  explicitly
  323. specify an output file name.  Initially defaults to "/EXT=.OUT".
  324.  
  325.  
  326. HTMSTRIP.DOC                         7                         Nov 19, 1998
  327.  
  328. "/COPY=path" specifies that the output files (for example,  BRUCE.OUT  when
  329. the input was BRUCE.HTM) are to be created in the  specified  subdirectory.
  330. By default, the program creates the output files in the same  path  as  the
  331. input files.  If the subdirectory does not exist, you will be prompted  for
  332. whether to create it or not based on the value of the /CREATE parameter.
  333.  
  334. "/CREATE" automatically creates the output subdirectory  if  /COPY=path  is
  335. specified.  The default is "/-CREATE"; if the subdirectory  is  not  there,
  336. the program prompts whether it should be created or not.
  337.  
  338. "/ALL" says that if the program encounters what it thinks is  just  a  text
  339. file, it should take the file and try to fix up CR/LF problems (Unix  files
  340. end with LF's instead of CR/LF which is what DOS needs) and that's it. This
  341. can be somewhat risky since it may misdiagnose a file but it should be safe
  342. if you're running it on your cache  subdirectory.   Initially  defaults  to
  343. "/-ALL" which means it won't process it unless it thinks it's an HTML file.
  344.  
  345. "/-ALL" says to skip files if the program thinks it's  not  an  HTML  file.
  346. This is initially the default.
  347.  
  348. "/ATTR=attribs" allows you to specify a combination of attributes that  you
  349. want considered.  You can specify  any  combination  of  R  (read-only),  H
  350. (hidden), S (system), or A (archive bit).  Precede  any  character(s)  with
  351. "-" to exclude instead of include.  Unlike with the DOS  DIR  command,  the
  352. inclusions and exclusions are subject to  "OR"  conditions;  /ATTR=HS  will
  353. retrieve any file that is either hidden or a system file or both.  You  can
  354. specify "/ATTR=ALL"  to  specify  that  all  files  are  to  be  processed.
  355. Initially defaults to /ATTR=-H-S (skip hidden or system files).
  356.  
  357. "/WIDTH=n" specifies the desired line length for wrapping  long  lines  and
  358. also for centering.  Initially defaults to "/WIDTH=80".
  359.  
  360. "/FORCE" says that the specified  width  must  be  adhered  to.   The  only
  361. exception to this is that tables may force a width expansion if  the  cells
  362. simply  can't  fit  on  the  page  otherwise.   Using  /FORCE  means   that
  363. <PRE>...</PRE> blocks may be wrapped (typically a no-no) and some words  in
  364. tables may get split up if the entire word can't fit in the  computed  cell
  365. width.  The latter is especially a  problem  if  there  are  lots  of  cell
  366. columns in a table; there isn't much room for  the  actual  data  when  the
  367. cells themselves take up so much space.  Initially defaults to "/-FORCE".
  368.  
  369. "/-FORCE" says that the desired widths can be ignored  if  table  cells  or
  370. <PRE>...</PRE>  blocks  would  look  more  natural  without  it.   This  is
  371. initially the default.
  372.  
  373.  
  374. HTMSTRIP.DOC                         8                         Nov 19, 1998
  375.  
  376. "/RULE=s" specifies that a string is to be repeated the width of the  line.
  377. This is used to separate sections.  The string can be:
  378.   * a single character (for example: /RULE=- ),
  379.   * multiple characters (for example: /RULE="- " ),
  380.   * it can contain decimal and hexadecimal characters
  381.     (like "/RULE=\066\097\116"--see BRUCEHEX.DOC),
  382.   * "/RULE=NULL" or "/-RULE" (both generate blank lines like "/RULE=\32")
  383.   * "/RULE" which picks a setting for you based on /BORDER=c:
  384.       * If /BORDER=S, is the same as "/RULE=\196" or "RULE=─"
  385.       * If /BORDER=D, is the same as "/RULE=\205" or "RULE=═"
  386.       * If other,     is the same as "/RULE=\045" or "RULE=-"
  387.   * Left out in which case the default "/RULE=-" is used
  388. Personally, if your  printer  supports  IBM  graphics  characters,  I  find
  389. "/RULE=\196" to be the most pleasing of the rule lines.
  390.  
  391. "/BORDER=c" specifies the type of border to use.  The possible choices  for
  392. "c" are:
  393.   D  -- double line around row and stub, single lines elsewhere
  394.   S  -- single line
  395.   T  -- text character line    -- this is the default
  396.   B  -- blanks (spaces)
  397.   N  -- none
  398.   DV -- double line is used around row and stub, lines are skipped in
  399.         horizontal rows within the table itself
  400.   SV -- same as DV except single line
  401.   TV -- same as DV except text lines
  402. Examples of the various border types:
  403.  
  404.      <D>ouble       <S>ingle        <T>ext         <B>lank        <N>one
  405.    ╔═══╦═══╤═══╗  ┌───┬───┬───┐  +---+---+---+
  406.    ║ 1 ║ 2 │ 3 ║  │ 1 │ 2 │ 3 │  | 1 | 2 | 3 |    1   2   3      1   2   3
  407.    ╠═══╬═══╪═══╣  ├───┼───┼───┤  +---+---+---+                   4   5   6
  408.    ║ 4 ║ 5 │ 6 ║  │ 4 │ 5 │ 6 │  | 4 | 5 | 6 |    4   5   6      7   8   9
  409.    ╟───╫───┼───╢  ├───┼───┼───┤  +---+---+---+
  410.    ║ 7 ║ 8 │ 9 ║  │ 7 │ 8 │ 9 │  | 7 | 8 | 9 |    7   8   9
  411.    ╚═══╩═══╧═══╝  └───┴───┴───┘  +---+---+---+
  412.  
  413.                       <DV>           <SV>           <TV>
  414.                   ╔═══╦═══╤═══╗  ┌───┬───┬───┐  +---+---+---+
  415.                   ║ 1 ║ 2 │ 3 ║  │ 1 │ 2 │ 3 │  | 1 | 2 | 3 |
  416.                   ╠═══╬═══╪═══╣  ├───┼───┼───┤  +---+---+---+
  417.                   ║ 4 ║ 5 │ 6 ║  │ 4 │ 5 │ 6 │  | 4 | 5 | 6 |
  418.                   ║ 7 ║ 8 │ 9 ║  │ 7 │ 8 │ 9 │  | 7 | 8 | 9 |
  419.                   ╚═══╩═══╧═══╝  └───┴───┴───┘  +---+---+---+
  420.  
  421. Note that the /BORDER=D,  /BORDER=DV,  and  /BORDER=SV  presume,  as  shown
  422. above, that the table has a one-column stub and a  one-row  column  header.
  423. This is normal for many tables but  not  all.   When  in  doubt,  stick  to
  424. something like /BORDER=S or /BORDER=T.
  425.  
  426. "/BUFF=n" specifies how many spaces to  position  on  either  side  of  the
  427. vertical bars in the tables.  Defaults to /BUFF=1.
  428.  
  429.  
  430. HTMSTRIP.DOC                         9                         Nov 19, 1998
  431.  
  432. "/SPACES" retains extra  vertical  spacing  between  sections.   There  are
  433. frequently lots of extra blank lines that appear in the output file  either
  434. due to specific HTML requests or to insure proper reformatting.  Specifying
  435. /SPACES allows these to stay there.
  436.  
  437. "/-SPACES" removes these extra blank lines.   This  also  tries  to  remove
  438. empty columns in tables as well as some blank  rows  in  tables.   This  is
  439. initially the default.
  440.  
  441. "/RSPACE" requires that a blank line appear  before  and  after  horizontal
  442. rule (<HR>) indicators.  Using this option with /SPACES may cause  multiple
  443. blank lines around horizontal rules.  Initially defaults to "/-RSPACE".
  444.  
  445. "/-RSPACE" doesn't force a blank line around  horizontal  rule  indicators.
  446. This is initially the default.
  447.  
  448. "/WARNINGS" displays on-screen warnings when HTMSTRIP finds either internal
  449. problems in the document or things it can't handle.  Realistically, they're
  450. not all that important because the program is working  around  them  anyway
  451. but you might want to use them to help make suggestions to  the  webmaster.
  452. If you create a logfile (using the "/LOG=filename" parameter), the warnings
  453. are automatically written out to that file independently of the "/WARNINGS"
  454. setting.  Initially defaults to "/-WARNINGS".
  455.  
  456. "/-WARNINGS" turns  off  the  warning  messages.   This  is  initially  the
  457. default.
  458.  
  459. "/TABLE" says to process text within table declaration sections  as  tables
  460. whenever the program can.  There are some maximum cell length limits in the
  461. program and some tabular text will be dumped as straight ASCII text anyway.
  462. This is initially the default.
  463.  
  464. "/-TABLE" says to  process  text  within  table  declarations  sections  as
  465. straight text, removing it from the tabular structure entirely.  There  are
  466. other cases where page authors  have  switched  to  tables  for  formatting
  467. purposes and, when you convert the resulting page, you're left with  mostly
  468. spaces.  Initially defaults to "/TABLE".
  469.  
  470. "/-INDENT" removes block indent sections from the output file.  By default,
  471. five    spaces    are    inserted    before    each    line    within     a
  472. <BLOCKQUOTE>...</BLOCKQUOTE> block.  These can be nested so you can end  up
  473. with a lot of white space in your document.   "/-INDENT"  turns  them  off.
  474. Initially defaults to "/INDENT".
  475.  
  476. "/INDENT" retains  the  <BLOCKQUOTE>...</BLOCKQUOTE>  indenting.   This  is
  477. initially the default.
  478.  
  479.  
  480. HTMSTRIP.DOC                         10                        Nov 19, 1998
  481.  
  482. "/CPn" specifies what character  pageset  to  use  when  processing  entity
  483. references.  For example, should the ° entity be displayed as the  word
  484. "degree", the 8-bit DOS character "°" or the Windows character "░".   (This
  485. setting does not impact things like tables and rulers, which you're setting
  486. yourself.) "n" can be 1, 2, or 3:
  487.  
  488.   /CP1 specifies that the program should use the 7-bit DOS  character  set.
  489.        This is the most universally recognized character set out there  and
  490.        should work for printing, e-mail, etc.  It does not  handle  foreign
  491.        characters or miscellaneous symbols like "£" so these are translated
  492.        into   rough    ASCII    equivalents.     Since    this    is    the
  493.        lowest-common-denominator font, it's initially the default for  this
  494.        routine.  Add /CP2 or /CP3 to your HTMSTRIP.INI file if you want  to
  495.        change on a regular basis.
  496.   /CP2 specifies that the program should use the 8-bit DOS  character  set.
  497.        This works within DOS applications but doesn't read correctly  under
  498.        Windows programs.
  499.   /CP3 specifies  that  the  program  should  use  the  ISO  8859/1   8-bit
  500.        single-byte graphic character set.  This set  works  within  Windows
  501.        applications but may not e-mail correctly.
  502.  
  503. "/A=spec" tells the program how to handle <A...> hypertext links.  See  the
  504. "How hypertext links (<A>)  are  displayed"  discussion  above.   Initially
  505. defaults to "/A=NONE".
  506.  
  507. "/A" is the same thing as "/A=FSITE".
  508.  
  509. "/-A" is the same thing as "/A=NONE".
  510.  
  511. "/IMG=spec" tells the program how to handle <IMG...> links.  These are used
  512. for embedded graphics.  "/IMG=spec" says to use the "src=" specification in
  513. place of any "alt=" specification.  See the "How image elements (<IMG>) are
  514. displayed" discussion below.  Initially defaults to "/IMG=NONE".
  515.  
  516. "/IMG" is the same thing as "/IMG=FSITE".
  517.  
  518. "/-IMG" is the same thing as "/IMG=NONE".
  519.  
  520. "/IMGALT=spec" is mutually exclusive with the "/IMG=spec" specification and
  521. again tells the program how to handle <IMG...> links.  "/IMGALT=spec"  says
  522. to use a "alt=" specification if one is provided before  falling  back  and
  523. using the "src=" specification.  If "/ALTONLY"  is  specified,  the  "src="
  524. specification will not be used at all.  See the "How image elements (<IMG>)
  525. are displayed" discussion below.  Initially defaults to "/IMGALT=NONE".
  526.  
  527. "/IMGALT" is the same thing as "/IMGALT=FSITE".
  528.  
  529. "/-IMGALT" is the same thing as "/IMGALT=NONE".
  530.  
  531.  
  532. HTMSTRIP.DOC                         11                        Nov 19, 1998
  533.  
  534. "/MAP=spec"  and  "/MAPALT=spec"  work  the   same   as   "/IMG=spec"   and
  535. "/IMGALT=spec" (except /MAP=SYMBOL and /MAPALT=SYMBOL  are  not  supported)
  536. but they apply to <AREA> specifications within a <MAP>...</MAP> block.  See
  537. the "How client-side imagemaps (<MAP> and <AREA>) are displayed" discussion
  538. below.  Initially defaults to "/MAP=NONE" (which is the same as "/-MAP").
  539.  
  540. "/MAP" is the same as "/MAP=FSITE".
  541.  
  542. "/ALTONLY" specifies that if an ALT=alias reference exists in  an  <IMG...>
  543. or <AREA...> link, then the alias should be embedded  in  the  output  text
  544. (appearing within brackets)  but,  otherwise,  all  <IMG...>  or  <AREA...>
  545. references are to be ignored  in  the  input  file.   See  the  "How  image
  546. elements (<IMG>) are displayed" and "How client-side Imagemaps  (<MAP>  and
  547. <AREA>)  are  displayed"  discussions   below.    Initially   defaults   to
  548. "/-ALTONLY".
  549.  
  550. "/-ALTONLY" allows <IMG...> and <AREA...> references to be added to  output
  551. file even if an ALT=alias reference is not specified.   This  is  initially
  552. the default.  See the "How image elements (<IMG>) are displayed"  and  "How
  553. client-side imagemaps (<MAP> and <AREA>) are displayed" discussions below.
  554.  
  555. "/HTTP=cc" specifies the two characters that are to appear around the  text
  556. substitution  in   /A=spec,   /IMG=spec,   /IMGALT=spec,   /MAP=spec,   and
  557. /MAPALT=spec items.   Initially  defaults  to  "/HTTP=[]";  the  site  name
  558. (typically) is preceded by " [" (including the leading space) and  followed
  559. by "]  "  (including  the  trailing  space).   If  only  one  character  is
  560. specified, it is the same as repeating it  so  "/HTTP=*"  is  the  same  as
  561. "/HTTP=**".  You can  also  specify  /HTTP=NULL  but  the  leading/trailing
  562. spaces will still be used.
  563.  
  564. "/-INPUT" skips any indication of the <INPUT> flags.  Initially defaults to
  565. "/INPUT".
  566.  
  567. "/INPUT" shows <INPUT> flags.   This  allows  the  "<INPUT>  =  5<@+>"  (or
  568. however you have it defined) from HTMSTRIP.INI to be  activated.   This  is
  569. initially the default.
  570.  
  571. "/L" says to read "&xxx;" entity references and  "<A>"  etc  symbol  lookup
  572. codes from your /Iinitfile file.  This is initially the default.
  573.  
  574. "/Linitfile" says to read the  "&xxx;"  entity  references  and  "<A>"  etc
  575. symbol lookup codes from the specified file "initfile".  Specifying another
  576. file is primarily useful if you want to have a  master  *.INI  file  and  a
  577. separate code lookup table.  Initially defaults to "/L".
  578.  
  579. "/-L" says to not process any entity references  or  symbol  lookup  codes.
  580. Initially defaults to "/L".
  581.  
  582.  
  583. HTMSTRIP.DOC                         12                        Nov 19, 1998
  584.  
  585. "/FILTER" specifies that the program is to replace specific  characters  in
  586. the input  file.   See  the  "Defining  Character-Translations"  discussion
  587. below.  When this parameter is in effect, the program looks  for  character
  588. translations in the entity reference  file  (/Linitfile),  which  typically
  589. defaults to your initialization file (/Iinitfile).  The  is  initially  the
  590. default.
  591.  
  592. "/FILTER=filename" specifies that  a  filter  is  to  be  applied  and  all
  593. character replacements are in  the  file  "filename".   See  the  "Defining
  594. Character-Translations" discussion below.
  595.  
  596. "/-FILTER" says to not bother removing the nonprintable characters from the
  597. output.  Initially defaults to "/FILTER".
  598.  
  599. "/LOG=logfile" specifies that the program should create a simple  log  file
  600. showing what files were processed  when  and  what  (if  any)  errors  were
  601. encountered.  If the logfile exists already, it will be appended to  (lines
  602. will be added to the end of it).  If no drive or  path  is  specified,  the
  603. file will be created in your default drive or path.  Initially defaults  to
  604. "/-LOG" (don't create a logfile).
  605.  
  606. "/-LOG" says to not create a log  file  at  all.   This  is  initially  the
  607. default.
  608.  
  609. "/LOG" is the same as "/LOG=HTMSTRIP.LOG".
  610.  
  611. "/T=temp_dir" specifies where to write the temporary files that the routine
  612. needs.  Examples are "/T=C:"  and  "/T=C:\TEMP".   If  not  specified,  the
  613. routine writes to the following in sequence:
  614.  
  615.   - the value of any TEMP, then TMP, environmental variable
  616.   - C:\TEMP
  617.   - C:\
  618.  
  619. "/MONO" (or "/-COLOR") does not try to override screen  colors.   Initially
  620. defaults to "/COLOR".
  621.  
  622. "/COLOR" (or "/-MONO") allows screen colors  to  be  overridden.   This  is
  623. initially the default.
  624.  
  625. "/Iinitfile" says to  read  an  initialization  file  with  the  file  name
  626. "initfile".  The file specification *must* contain a period.  If  no  drive
  627. or path information is specified, the  program  will  search  for  initfile
  628. beginning in your default subdirectory and then going throughout  your  DOS
  629. path.  The use of an initialization file is optional.   Initially  defaults
  630. to "/IHTMSTRIP.INI".
  631.  
  632. "/-I" (or "/INULL") says to skip loading  the  initialization  file.   Note
  633. that this also drops loading the file that translates things  like  "&xxx;"
  634. so you should specify /Linitfile if you drop the other file.
  635.  
  636.  
  637. HTMSTRIP.DOC                         13                        Nov 19, 1998
  638.  
  639. "/ENV" says to look for %var% occurrences in the command line  and  try  to
  640. resolve any apparent environmental variable references.   See  BRUCEINI.DOC
  641. for more information.  This is initially the default.
  642.  
  643. "/-ENV" says to skip resolving apparent %var% occurrences  in  the  command
  644. line.  Initially defaults to "/ENV".
  645.  
  646. "/?" or "/HELP" or "HELP" shows you the syntax for the command.
  647.  
  648. "/?HEX" gives you a hexadecimal and decimal conversion table.
  649.  
  650.  
  651. Return codes:
  652.  
  653. HTMSTRIP returns the following ERRORLEVEL codes:
  654.  
  655.         0 = no problems, all files processed
  656.       251 = could not find a file to process
  657.       253 = operation aborted by pressing Escape
  658.       255 = syntax problems, or /? requested
  659.  
  660.  
  661.  
  662. HTMSTRIP.DOC                         14                        Nov 19, 1998
  663.  
  664. How hypertext links (<A>) are displayed:
  665.  
  666. Hypertext links are placed in an HTML page to indicate  that  if  the  user
  667. clicks in the defined "hot" area, they will be taken to an appropriate page
  668. (or another section of the same page).  A typical hypertext link  would  be
  669. something like:
  670.  
  671.         To enter Elsie's Picture Page, click
  672.         <a href="http://www.erols.com/waynesof/elsie.htm">here!</a>
  673.  
  674. Using a browser like Netscape Navigator  or  Internet  Explorer,  the  user
  675. would see this as:
  676.  
  677.         To enter Elsie's Picture Page, click here!
  678.  
  679. and "here!" would normally be underlined and perhaps be in red.
  680.  
  681. How HTMSTRIP reveals hypertext links is based on the /A=spec parameter. The
  682. values of "spec" are mutually exclusive:
  683.  
  684.       /A=FSITE    says to show the site name, using its full  url  address,
  685.                   and embed this name in the body of the text page
  686.       /A=FSITEFN  says to show the site name, using its full  url  address,
  687.                   and place this site name in a footnote section at the end
  688.                   of the text page
  689.       /A=SITE     says to show the site name, but only the part  after  the
  690.                   last "/" or "\", and embed this name in the body  of  the
  691.                   text page
  692.       /A=SITEFN   says to show the site name, but only the part  after  the
  693.                   last "/" or "\", and place this site name in  a  footnote
  694.                   section at the end of the text page
  695.       /A=SYMBOL   says to use the specified <A> symbol  (initially  defined
  696.                   as "(link)" in the HTMSTRIP.INI file)
  697.       /A=NONE     (or /-A) says that nothing is to be shown  for  hypertext
  698.                   links.  This is initially the default.
  699.  
  700. Given:
  701.  
  702.         To enter Elsie's Picture Page, click
  703.         <a href="http://www.erols.com/waynesof/elsie.htm">here!</a>
  704.  
  705. Setting             Yields
  706. -------             ------
  707. /A=FSITE            [http://www.erols.com/waynesof/elsie.htm]
  708. /A=FSITEFN          [1] http://www.erols.com/waynesof/elsie.htm (footnote)
  709. /A=SITE             [elsie.htm]
  710. /A=SITEFN           [1] elsie.htm       (footnote)
  711. /A=SYMBOL           (link)
  712. /A=NONE                                 (is not shown)
  713.  
  714.  
  715.  
  716. HTMSTRIP.DOC                         15                        Nov 19, 1998
  717.  
  718. How image elements (<IMG>) are displayed:
  719.  
  720. Image elements are put in HTML code to indicate that a graphical  image  is
  721. to be inserted at this point.  A typical  image  element  might  look  like
  722. this:
  723.  
  724.         <IMG SRC="../movies/Anaconda/assets/title.gif" border=0
  725.         alt="Anaconda - click to enter">
  726.  
  727. Presuming the Web browser has graphics enabled, the browser will  load  the
  728. title.gif graphic from the specified site (the  example  here  is  using  a
  729. relative reference to the site instead  of  an  absolute  one--don't  worry
  730. about it).
  731.  
  732. If the browser does not support graphics, the text displayed in the  "alt="
  733. parameter (in our case "Anaconda - click to enter") will be displayed.   If
  734. no "alt=" parameter is provided, some symbol like "(image)" will be  filled
  735. in instead.  You'll frequently see the "alt=" text  if  the  graphic  takes
  736. awhile to load; most browsers show the text to give  you  a  head's  up  of
  737. what's being loaded.  Under some of the newer  browsers,  the  "alt="  text
  738. will be displayed if you move your cursor over the image.
  739.  
  740. Note that unlike the "src="  specification,  the  "alt="  specification  is
  741. strictly optional under the HTML specifications.  Some images will have one
  742. defined, most won't.
  743.  
  744. How  HTMSTRIP  displays  these  links  is  based   on   three   parameters:
  745. "/IMG=spec", "/IMGALT=spec", and "/ALTONLY".
  746.  
  747. "/IMG=spec" and "/IMGALT=spec" are mutually exclusive.  The "spec" part  of
  748. them functions almost  identically  to  how  they  work  in  the  "/A=spec"
  749. parameter (above).
  750.  
  751. If "/IMG=spec" is used, the "SRC=" attribute is used exclusively.
  752.  
  753. If "/IMGALT=spec" is used, the "ALT="  attribute  is  used  if  it  exists,
  754. otherwise,  the  "SRC="  attribute  is  used  unless  "/ALTONLY"  is   also
  755. specified.
  756.  
  757. If "/IMGALT=spec" and "/ALTONLY" are used, then  the  "ALT="  attribute  is
  758. used.  If one does not exist in the  image  element,  a  symbol  (typically
  759. "(image)") is used instead.
  760.  
  761. The values of "spec" are mutually  exclusive  and  are  documented  in  the
  762. "/A=spec" section above.  Initially, the parameters default to  "/IMG=NONE"
  763. (and "/IMGALT=NONE") and "/-ALTONLY".  This results in nothing being  shown
  764. for image elements.
  765.  
  766.  
  767. HTMSTRIP.DOC                         16                        Nov 19, 1998
  768.  
  769. Given:
  770.  
  771.         <IMG SRC="../movies/Anaconda/assets/title.gif" border=0
  772.         alt="Anaconda - click to enter">
  773.  
  774. Setting             Yields
  775. -------             ------
  776. /IMG=FSITE          [../movies/Anaconda/assets/title.gif]
  777. /IMG=FSITEFN        [1] ../movies/Anaconda/assets/title.gif (footnote)
  778. /IMG=SITE           [title.gif]
  779. /IMG=SITEFN         [1] title.gif       (footnote)
  780. /IMG=SYMBOL         (image)
  781. /IMG=NONE                               (is not shown)
  782.  
  783. Setting             Yields (if "alt=" specification present)
  784. -------             ----------------------------------------
  785. /IMGALT=FSITE       [Anaconda - click to enter]
  786. /IMGALT=FSITEFN     [1] Anaconda - click to enter (footnote)
  787. /IMGALT=SITE        [Anaconda - click to enter]
  788. /IMGALT=SITEFN      [1] Anaconda - click to enter (footnote)
  789. /IMGALT=SYMBOL      [Anaconda - click to enter]
  790. /IMGALT=NONE                            (nothing shown)
  791.  
  792. Given an image element without an "alt=" specification:
  793.  
  794.         <IMG SRC="../movies/Anaconda/assets/title.gif">
  795.  
  796. If  /-ALTONLY  is  operating,  /IMGALT=spec  is  treated   identically   to
  797. /IMG=spec; the "src=" specification is used.  However, if  /ALTONLY  is  in
  798. effect:
  799.  
  800. Setting             Yields (if no "alt=" spec and /ALTONLY in effect)
  801. -------             --------------------------------------------------
  802. /IMGALT=FSITE                           (nothing shown)
  803. /IMGALT=FSITEFN                         (nothing shown)
  804. /IMGALT=SITE                            (nothing shown)
  805. /IMGALT=SITEFN                          (nothing shown)
  806. /IMGALT=SYMBOL      (image)
  807. /IMGALT=NONE                            (nothing shown)
  808.  
  809.  
  810.  
  811. HTMSTRIP.DOC                         17                        Nov 19, 1998
  812.  
  813. How client-side imagemaps (<MAP> and <AREA>) are displayed:
  814.  
  815. Client-side imagemaps are used for sites that display something like a  map
  816. and allow you to click on different parts of the map and go to a  different
  817. place.  As your mouse cursor moves over the  image,  it  typically  changes
  818. from an arrow to a hand  and  back  again  as  it  hits  these  pre-defined
  819. hotspots.  In general, imagemaps are relatively hard to set up and  they're
  820. not in wide use.
  821.  
  822. Here's an example of an imagemap taken from the ZDNet site:
  823.  
  824.   <MAP NAME="botnav">
  825.   <AREA SHAPE=RECT COORDS="0,12,83,26" HREF=http://www.zdnet.com/
  826.      ALT="ZDNet Home Page">
  827.   <AREA SHAPE=RECT COORDS="84,12,150,26" HREF=javascript:popup()
  828.      ALT="ZDNet Site Map">
  829.   <AREA SHAPE=RECT COORDS="151,12,246,26"
  830.      HREF=http://xlink.zdnet.com/cgi-bin/texis/xlink/xlink/welcome.html
  831.      ALT="Search ZDNet">
  832.   <AREA SHAPE=RECT COORDS="248,12,327,26"
  833.      HREF=http://xlink.zdnet.com/cgi-bin/texis/xlink/xlink?config=whatsnew
  834.      ALT="What's New on ZDNet">
  835.   <AREA SHAPE=RECT COORDS="328,12,383,26" HREF=/adverts/adinfo/
  836.      ALT="ZDNet Advertising Info">
  837.   <AREA SHAPE=RECT COORDS="384,12,468,26"
  838.      HREF=http://www.zdnet.com/cgi-bin/contact ALT="ZDNet Contact Us">
  839.   </MAP>
  840.   <img WIDTH=468 HEIGHT=26
  841.      SRC="http://www.zdnet.com/graphics/nav/botnav.gif"
  842.      border=0 align=top vspace=7 usemap="#botnav">
  843.  
  844. This imagemap says to bring in a graphic image ("botnav.gif") and  use  the
  845. separately-defined map ("botnav") to identify certain hotspots.
  846.  
  847. HTMSTRIP doesn't display graphics at all so you're not going to get a great
  848. feeling for how the imagemap would be  displayed  using  the  program.   It
  849. will, however, show you what links are called upon if that's what you  want
  850. it to do.  The way that it  handles  these  is  with  the  "/MAP=spec"  and
  851. "/MAPALT=spec" parameters.  They work very similarly to how "/IMG=spec" and
  852. "/IMGALT=spec" are handled including  how  /ALTONLY  affects  things.   The
  853. initial default for HTMSTRIP is "/MAP=NONE" which means the image maps  are
  854. skipped entirely.
  855.  
  856.  
  857. HTMSTRIP.DOC                         18                        Nov 19, 1998
  858.  
  859. Given:
  860.  
  861.   <MAP>
  862.   <AREA SHAPE=RECT COORDS="0,12,83,26" HREF=http://www.zdnet.com/index
  863.      ALT="ZDNet Home Page">
  864.   </MAP>
  865.  
  866. Setting             Yields
  867. -------             ------
  868. /MAP=FSITE          Map: {  [http://www.zdnet.com/index]  }
  869. /MAP=FSITEFN        [1] http://www.zdnet.com/index     (footnote)
  870. /MAP=SITE           Map: {  [index]  }
  871. /MAP=SITEFN         [1] index                          (footnote)
  872. /MAP=SYMBOL                (results in error message)
  873. /MAP=NONE                  (nothing shown)
  874.  
  875. Setting             Yields (if "alt=" specification present)
  876. -------             ----------------------------------------
  877. /MAPALT=FSITE       Map: {  [ZDNet Home Page]  }
  878. /MAPALT=FSITEFN     [1] ZDNet Home Page    (footnote)
  879. /MAPALT=SITE        Map: {  [ZDNet Home Page]  }
  880. /MAPALT=SITEFN      [1] ZDNet Home Page    (footnote)
  881. /MAPALT=SYMBOL             (results in error message)
  882. /MAPALT=NONE               (nothing shown)
  883.  
  884. Given an imagemap without an "alt=" specification:
  885.  
  886.   <MAP>
  887.   <AREA SHAPE=RECT COORDS="0,12,83,26" HREF=http://www.zdnet.com/index>
  888.   </MAP>
  889.  
  890. If  /-ALTONLY  is  operating,  /MAPALT=spec  is  treated   identically   to
  891. /MAP=spec; the "href=" specification is used.  However, if /ALTONLY  is  in
  892. effect:
  893.  
  894. Setting             Yields (if no "alt=" spec and /ALTONLY in effect)
  895. -------             --------------------------------------------------
  896. /MAPALT=FSITE       Map: {  }
  897. /MAPALT=FSITEFN     Map: {  }
  898. /MAPALT=SITE        Map: {  }
  899. /MAPALT=SITEFN      Map: {  }
  900. /MAPALT=SYMBOL             (results in error message)
  901. /MAPALT=NONE               (nothing shown)
  902.  
  903.  
  904.  
  905. HTMSTRIP.DOC                         19                        Nov 19, 1998
  906.  
  907. Defining entity references:
  908.  
  909. HTMSTRIP will process an entity reference definition file is one is  found.
  910. This table can be in your standard *.INI file (for  example,  HTMSTRIP.INI)
  911. if desired or it can be a separate  file  specified  using  the  /Linitfile
  912. parameter.
  913.  
  914. Entity references  are  how  non-standard  characters  like  the  copyright
  915. character are handled in HTML pages.  Entity references  are  indicated  as
  916. "&xxx;" where "xxx" is either a code or a number preceded by a pound  sign.
  917. The copyright symbol, for example, is indicated in HTML as "©".
  918.  
  919. A default HTMSTRIP.INI is provided with over 300 entity reference  lookups.
  920. To define or change these lookups, the INI file should include a series  of
  921. lines in the following format:
  922.  
  923.         &xxx; = _outstr1_outstr2_outstr3_
  924.  
  925. where "&xxx;" is the HTML sequence and "outstr1", "outstr2", and  "outstr3"
  926. is what you want to replace it with.   There  are  three  available  lookup
  927. strings to match the setting for the character pageset parameter ("/CPn"):
  928. * The first character(s) ("outstr1")  correspond  to  the  characters  used
  929.   under 7-bit DOS (/CP1).  Files created using this character  set  can  be
  930.   e-mailed to anyone and looks identical under DOS  and  Windows.   Foreign
  931.   characters  and  symbols  are  translated  into  fairly  boring,  generic
  932.   characters.
  933. * The second character(s) ("outstr2") correspond  to  the  characters  used
  934.   under 8-bit DOS (/CP2).  Files created using this character set look fine
  935.   under DOS but look sick under Windows.
  936. * The third character(s) ("outstr3")  correspond  to  the  characters  used
  937.   under the ISO 8859/1 8-bit  single-byte  graphic  character  set.   Files
  938.   created using this character set look fine under  Windows  but  look  bad
  939.   under DOS.
  940.  
  941. For example:
  942.  
  943.         Æ    = _AE_Æ_╞_
  944.  
  945. will use "AE" if /CP1 is in effect, "Æ" if /CP2 is in effect,  and  "╞"  if
  946. /CP3 is in effect.  Note that at least one of these "outstr" elements  will
  947. look incorrect to you if you're viewing this help  file  under  Windows  or
  948. DOS.  See the discussion about ENTITY.HTM below in order  to  see  how  the
  949. different character sets are viewed under different environments.
  950.  
  951. In cases where the characters are identical between all character sets, you
  952. can just include the lookup once:
  953.  
  954.         &      = &
  955.  
  956. The same lookup value will be  used  irregardless  of  what  character  set
  957. you're under.
  958.  
  959.  
  960. HTMSTRIP.DOC                         20                        Nov 19, 1998
  961.  
  962. The  "outstr"  portions  can  consist  of  regular  non-space  ASCII   text
  963. characters (like "A" or "z") as well as hexadecimal  values  (in  the  form
  964. &Hxx) or decimal values (in the form \nnn).  (See the  BRUCEHEX.DOC  file.)
  965. They can also be the word "NULL" which translates the string into  nothing.
  966. You cannot use a space or equal sign in "outstr"; use  the  hexadecimal  or
  967. decimal representations instead.  The table does not  have  to  be  in  any
  968. specified order.  Lines can end with "/*" followed  by  a  comment  if  you
  969. want.  Examples:
  970.  
  971.         ¢     = _cents_¢_ó_         /* Cent symbol
  972.         ©     = _(c)_(c)_⌐_         /* Copyright symbol
  973.         °      = _degree_°_░_        /* Degree symbol
  974.               = \032                /* Thick space
  975.  
  976. Remember that "&xxx;" entity references  (yes,  I  hate  that  phrase)  are
  977. case-sensitive in HTML.  "°" will not find "&Deg;".
  978.  
  979. There seems to be a trend of late to relax some of the  replacement  coding
  980. requirements in Web pages.  The ";" is now, apparently, becoming  optional.
  981. Numeric replacements (for example, " ") seem to no longer  require  the
  982. leading pound sign.  Therefore, HTMSTRIP looks for both of these iterations
  983. for any appropriate lookup.  "©" will find "©" and  "™"  will
  984. find "&153".  The lookup itself has to be entered in the  formally  correct
  985. way though.
  986.  
  987. You can see how these files will be processed under each character  pageset
  988. by testing out the ENTITY.HTM file that is provided with  the  HTMSTymm.ZIP
  989. file.  This contains all of the entity references defined  in  HTMSTRIP.INI
  990. as of March 1997.
  991.  
  992. To try all three of the character sets, issue the following commands:
  993.  
  994.         HTMSTRIP ENTITY.HTM ENTITY.DOS /CP1
  995.         HTMSTRIP ENTITY.HTM ENTITY.IBM /CP2
  996.         HTMSTRIP ENTITY.HTM ENTITY.WIN /CP3
  997.  
  998. Then view the resulting files under the DOS EDIT command as well  as  under
  999. the Windows Notepad program.
  1000.  
  1001. You may also find the ASCII character set document (ASCII.TXT)  useful  for
  1002. seeing how different fonts effect characters.  View this  file  in  Notepad
  1003. using the Courier font, then change your default font to Terminal, and  see
  1004. it again.
  1005.  
  1006.  
  1007. HTMSTRIP.DOC                         21                        Nov 19, 1998
  1008.  
  1009. Defining the Symbolic References:
  1010.  
  1011. You are also allowed to redefine the strings  that  are  used  for  several
  1012. symbolic references in the entity reference file.   For  example,  if  your
  1013. source code contains  an  <IMG>  (inline  image)  reference,  HTMSTRIP  can
  1014. indicate this by putting some text in place of  the  image.   (HTMSTRIP  is
  1015. text only so it's not going to put the actual image in  there.)  The  first
  1016. three replacements shown below are conditional based on other parameters:
  1017.  
  1018. * The  <A>  indicator  replaces  hyperlink  references  if   /A=SYMBOL   is
  1019.   specified.
  1020. * The <IMG> indicator replaces inline image references  if  /IMG=SYMBOL  or
  1021.   /IMGALT=SYMBOL is specified.
  1022. * The <INPUT> indicator replaces input fields if  /INPUT  is  left  as  the
  1023.   default.
  1024. * <I> replaces italics-on and </I> replaces italics-off.
  1025. * <U> replaces underline-on and </U> replaces underline-off.
  1026. * <B> replaces bold-on and </B> replaces bold-off.  It  also  replaces  the
  1027.   strong-on <STRONG> and strong-off </STRONG> tags favored under  the  HTML
  1028.   4.0 specification.
  1029. * <EM> replaces emphasis-on and </EM> replaces emphasis-off.
  1030. * <TITLE> ... </TITLE> indicates how to handle the document's title.
  1031. * <H1> ... </H1> indicates how to handle the level 1 headings.   Similarly,
  1032.   <H2> ... </H2> through <H6> ...  </H6>  indicates  how  to  handle  those
  1033.   levels of headings.
  1034.  
  1035. The default indicators are the following:
  1036.  
  1037.         Symbol               Meaning          Default Value
  1038.         <A>                  hyperlinks        -> (link)
  1039.         <IMG>                inline image      -> (image)
  1040.         <INPUT>              input fields      -> 5<@+>
  1041.         <I> and </I>         italics on/off    -> (null)
  1042.         <U> and </U>         underline on/off  -> (null)
  1043.         <B> and </B>         bold on/off       -> (null)
  1044.         <EM> and </EM>       emphasis on/off   -> (null)
  1045.         <TITLE> and </TITLE> document title    -> (null)
  1046.         <H1> through <H6>
  1047.           and </H1> thru </H6> level headings  -> (null)
  1048.  
  1049. You can redefine any and all of these entity references in the same  lookup
  1050. file.  These substitutions are specified more or  less  like  the  previous
  1051. substitutions.  For example:
  1052.  
  1053.         <A>      = (link)
  1054.         <IMG>    = (image)
  1055.         <INPUT>  = 5<@+>
  1056.         <U>      = _
  1057.         </U>     = _
  1058.         <B>      = *
  1059.         </B>     = *
  1060.  
  1061.  
  1062. HTMSTRIP.DOC                         22                        Nov 19, 1998
  1063.  
  1064. Unlike with the other lookups, the left  side  is  not  case  sensitive  so
  1065. "<a>=(link)" works just fine.  Hexadecimal  and  decimal  replacements  are
  1066. again acceptable (see BRUCEHEX.DOC file).  You might, for example, want  to
  1067. redefine some of them like this:
  1068.  
  1069.         <A>      = \251     /* Replaces with a √ symbol
  1070.         <IMG>    = \015     /* Replaces with a  symbol (little flash cube)
  1071.         <INPUT>  = ?        /* Replaces with a question mark
  1072.  
  1073. The replacements aren't always perfect.  Web browsers  don't  italicize  or
  1074. display in bold spaces so the following  will  look  perfectly  fine  under
  1075. Netscape or Internet Explorer:
  1076.  
  1077.         The<B> Minnow </B>was Gilligan's ship.
  1078.  
  1079. However, if you have the following in your INI file:
  1080.  
  1081.         <B>     = *
  1082.         </B>    = *
  1083.  
  1084. The text will show up as:
  1085.  
  1086.         The* Minnow *was Gilligan's ship.
  1087.  
  1088. Which makes  it  look  like  the  wrong  words  are  emphasized.   This  is
  1089. unfortunate but it's the way things work.
  1090.  
  1091. If you normally print the results of  everything  from  HTMSTRIP,  you  can
  1092. probably find the print codes that are appropriate for  your  printer  that
  1093. will change the text in the way you want.
  1094.  
  1095. For example, if you're using a Hewlett-Packard  LaserJet  printer,  printer
  1096. codes are shown in the User's  Manual  which  can  do  different  types  of
  1097. bolding, underlining, etc.  You have to make sure that  you  turn  off  the
  1098. settings with the </xx> option (e.g.  </B>) though.  The  following  should
  1099. work on  many  HP  LaserJets  (check  your  manual  and  replace  with  the
  1100. appropriate codes if not):
  1101.  
  1102.         <I>      = \027(s1S   /* Turns italicizing on
  1103.         </I>     = \027(s0S   /* Turns italicizing off (restores upright)
  1104.         <U>      = \027&d0D   /* Turns underlining on
  1105.         </U>     = \027&d@    /* Turns underlining off
  1106.         <B>      = \027(s2B   /* Turns demi-bolding on
  1107.         </B>     = \027(s0B   /* Turns bolding off
  1108.         <EM>     = \027(s1B   /* Turns semi-bolding on
  1109.         </EM>    = \027(s0B   /* Turns bolding off (restores normal weight)
  1110.  
  1111. Note that the  program  counts  all  characters  (including  these  special
  1112. print-setting characters which don't  themselves  print)  when  it  reflows
  1113. text.  Also note that, on the HP at least, underlining underlines spaces as
  1114. well as characters, including indents.
  1115.  
  1116. Any symbolic references that you do not  redefine  will  default  to  their
  1117. original values.
  1118.  
  1119.  
  1120. HTMSTRIP.DOC                         23                        Nov 19, 1998
  1121.  
  1122. The <INPUT> item is a bit of  a  special  case.   It  has  several  special
  1123. options, and they are all present in the default value.
  1124.  
  1125. <INPUT> is used to indicate that the HTML page prompted for,  typically,  a
  1126. bit of text.  In the actual HTML page, this might be coded as:
  1127.  
  1128.         <INPUT NAME=q size=45 maxlength=200 VALUE="">
  1129.  
  1130. Ignoring most of the parameter, the "size=45" parameter says that  the  Web
  1131. navigator is to present an input line to the user which is 45 characters in
  1132. length.  "VALUE=""" indicates that no default value is  provided  for  this
  1133. input.
  1134.  
  1135. The default symbolic reference for handling an <INPUT> request is:
  1136.  
  1137.         <INPUT>  = 5<@+>
  1138.  
  1139. Each item of the assignment is explained below:
  1140.  
  1141.         <INPUT>  specifies the <INPUT> replacement
  1142.         5        means the maximum input length (SIZE=x) to be provided
  1143.                  is 5 characters; the value can be any number between 1
  1144.                  and 255; this rule is sometimes waived (see below)
  1145.         < and >  are extra text characters that will appear
  1146.         @        says to fill in the default value (VALUE="" above) is
  1147.                  one is provided
  1148.         +        says to expand the input field based on an specified
  1149.                  length (SIZE=45 above); if no SIZE= is provided on the
  1150.                  page, a default of SIZE=5 will be used; expansion is
  1151.                  done using underscore characters
  1152.  
  1153. With the above settings, if the program encountered this:
  1154.  
  1155.         <INPUT NAME=q size=45 maxlength=200 VALUE="">
  1156.  
  1157. It would actually write out the input references as:
  1158.  
  1159.         <___>
  1160.  
  1161. Similarly, if the program encountered this:
  1162.  
  1163.         <INPUT TYPE=submit VALUE=Submit>
  1164.  
  1165. It would write out this:
  1166.  
  1167.         <Submit>
  1168.  
  1169. On the other hand, the program will expand the field beyond  the  specified
  1170. maximum length if "@" (value) is requested and it's too large to fit in the
  1171. specified field length.  If the program encountered this:
  1172.  
  1173.         <INPUT TYPE=TEXT VALUE="This is my sample" SIZE=10>
  1174.  
  1175. It would write out this:
  1176.  
  1177.         <This is my sample>
  1178.  
  1179.  
  1180. HTMSTRIP.DOC                         24                        Nov 19, 1998
  1181.  
  1182. Defining Character-Translations (The Filter Table):
  1183.  
  1184. HTMSTRIP allows you to translate specified characters as the text is  read.
  1185. This is useful on output for characters that are defined under Windows  but
  1186. that's about it.  This should not be an issue because HTML is  supposed  to
  1187. be platform independent; the Web designer (or the  software  used  for  the
  1188. page) should have been smart enough to insert the proper  entity  reference
  1189. instead.
  1190.  
  1191. For example, "DisneyÆs" shows up on the Disney site for some  reason.   The
  1192. filter table will translate this as "Disney's".  Also,  way  too  many  Web
  1193. designers use decimal 169 ("⌐", as in "⌐  1996")  as  a  copyright  symbol;
  1194. they're supposed to use the entity reference  ©  instead.   The  filter
  1195. table will translate this as "c 1996".
  1196.  
  1197. There is a default character-translation table built into the entity lookup
  1198. file (HTMSTRIP.INI).  This will typically be loaded  automatically  by  the
  1199. program.  You can update the translations in the lookup  file  or  you  can
  1200. create  your  own  filter  file   and   invoke   it   by   specifying   the
  1201. "/FILTER=filename" parameter.  In most cases, however, you will not need to
  1202. modify this table.
  1203.  
  1204. The filter table is an ASCII text file which consists of a series of  lines
  1205. in the following format:
  1206.  
  1207.         inchar = outchar
  1208.  
  1209. where "inchar" is the character to change from  and  "outstr"  is  what  to
  1210. change the character to.  Both portions can consist  of  regular  non-space
  1211. ASCII text characters (like "A" or "z") as well as hexadecimal  values  (in
  1212. the form &Hxx) or decimal values (in  the  form  \nnn).   Both  sides  must
  1213. reference a single character (exactly one character  is  always  translated
  1214. into exactly one character).  You cannot use  a  space  or  equal  sign  in
  1215. either  "inchar"   or   "outchar";   use   the   hexadecimal   or   decimal
  1216. representations instead.  The table does not have to be  in  any  specified
  1217. order.  Lines can end with "/*" followed by a comment if you want.
  1218.  
  1219. Hexadecimal and decimal equivalents are explained in BRUCEHEX.DOC.
  1220.  
  1221. Examples:
  1222.  
  1223.              a    = A     /* Translate lowercase "a" into capital "A"
  1224.              \032 = _     /* Translate space (decimal 032, &H20 too) into
  1225.                              underscore
  1226.              \027 = \032  /* Translate escape character into a space
  1227.  
  1228. Some leading characters in INI files are  treated  specially  within  Wayne
  1229. Software programs.   INI  lines  that  begin  with  any  of  the  following
  1230. characters may lead to odd results:  "[", "/", "&", "\", ";", ":", "<", and
  1231. ",".  To avoid problems, use hexadecimal  or  decimal  representations  for
  1232. these characters.  For example, use \047 or &H2F if you  want  to  override
  1233. the definition of "/".
  1234.  
  1235.  
  1236.  
  1237. HTMSTRIP.DOC                         25                        Nov 19, 1998
  1238.  
  1239. Author:
  1240.  
  1241. This program was written by Bruce Guthrie of Wayne Software.   It  is  free
  1242. for use and redistribution provided relevant documentation is kept with the
  1243. program, no changes are made to the program or documentation, and it is not
  1244. bundled with commercial programs or charged  for  separately.   People  who
  1245. need to bundle it in for-sale packages must pay a $50 registration  fee  to
  1246. "Bruce Guthrie" at the following address.
  1247.  
  1248. Additional information about this and other Wayne Software programs can  be
  1249. found in the file BRUCE.DOC which should be included in  the  original  ZIP
  1250. file.  The recent change  history  for  this  and  the  other  programs  is
  1251. provided in the HISTORY.ymm file which should be in the same ZIP file where
  1252. "y" is replaced by the last digit of the year and "mm"  is  the  two  digit
  1253. month of the release; HISTORY.611 came out in  November  1996.   This  same
  1254. naming convention is used in naming the ZIP file (HTMSTymm.ZIP)  that  this
  1255. program was included in.
  1256.  
  1257. Comments and suggestions can also be sent to:
  1258.  
  1259.                 Bruce Guthrie
  1260.                 Wayne Software
  1261.                 113 Sheffield St.
  1262.                 Silver Spring, MD 20910
  1263.  
  1264.                 e-mail: WayneSof@erols.com   fax: (301) 588-8986
  1265.                 http://www.geocities.com/SiliconValley/Lakes/2414
  1266.              or find through http://www.erols.com/waynesof
  1267.  
  1268. Please provide an Internet e-mail address on all correspondence.
  1269.  
  1270. 
  1271.