HTTXPlugin
HTML to text conversion plugin for AWeb
by Gabriele Favrin
The author is in no way responsible for any damages these programs may cause.
Redistribution or modification is forbidden. If you improve these scripts
send me the new versions in an E-Mail.
Index:
With the HTTXPlugin you can use HTTX from within AWeb to save or print HTML
pages as text.
This version of the plugin requires at least AWeb II 3.3
(normal or SE version), HTTX 2.0 or newer and
AWNPipe 2.9 or newer by William Parker. Also, the command
"Delete" must be present in your C: directory.
Installer should already have installed all files in the proper directories
and configured AWeb , but if you prefer to install HTTX manually you
must proceed as described:
- Copy to the "AWeb/Plugins/HTTX" directory the following files:
- HTTXPlugin.awebrx
- HTTXPluginCP.awebrx
- HTTXPluginCFG.awebrx
- HTTXPluginPRT.awebrx
- HTTX <-- yes, also the HTTX executable!
- HTTXPlugin.doc.html
- HTTX.doc.ita
- HTTX.doc.eng
- Configure AWeb. HTTX may be called from AWeb in several ways. You may
want to use more than one method. Possibly user buttons AND frame popup menu
for save and print as well with HTTX save as text, print and configuration as
menu entries. You can also define "keys" for start the programs.
Il you are using AWeb 3.3SE you can't define menus or keys.
You must use the HTTX Control Panel and "link" it to a user
button.
The Control Panel is also useful to normal AWeb users as it can be left
on screen and it tracks the active AWeb window. It speeds up the saving,
or printing of multiple pages.
How to set properly set up HTTX in AWeb:
Menu, buttons, keys:
You can add three entries, one for Save as text (HTTXPlugin.awebrx), one for
Print as text (HTTXPluginPRT.awebrx) and one for the HTTX and plugin
configuration (HTTXPluginCFG.awebrx).
Or you can add a single entry for HTTX Control Panel
(HTTXPluginCP.awebrx).
Popup menu (frame)
Add the entries "Save As Text" and "Print As Text" (if
required) using the following commands.
save:
RUN AWebPath:Plugins/HTTX/HTTXPlugin.awebrx TARGET %i
print:
RUN AWebPath:Plugins/HTTX/HTTXPluginPRT.awebrx TARGET %i
Now it will be possible to save or print a single frame directly from the
popup menu (without using the plugin "Select frames" function).
Start HTTXPluginCFG.awebrx
with AWeb to configure HTTX.
A Reaction GUI will be displayed.
file save settings and print settings
- Line length
- Maximum length for each line.
- Indentation
- Indentation of <UL>, <OL> or <DL> lists.
- ANSI mode
- Conversion of HTML styles and LINKS (HREF and NAME) to ANSI sequences:
Modes are the following:
- Disabled: no ANSI conversion.
- Standard: conversion using standard ANSI codes.
- Optimized: conversion using optimized (Amiga) ANSI codes. Can be used
only while saving files and can cause compatibility problems with some
viewers.
- ANSI color
- Color used to render links in ANSI conversion.
- HR draw mode
- Line drawing for <HR> tag.
Modes are the following:
- Disabled: <HR> lines aren't rendered.
- ASCII (lines composed by "-")
- ANSI (lines composed by ANSI underlined spaces)
- Filenote type
- Filenote (comment) of the saved file:
- None: nothing is set as filenote.
- Document title: title (if one) of the HTML document is set as comment.
- Document URL: URL (if available) of the HTML document is set as comment.
- Convert entities to 7bit ASCII
- Conversion of HTML entities (accent letters, and so) to ASCII codes lower
than 128.
- Ignore text and HR alignment
- Don't center or right justify text and lines.
- Use EOL as table cell separator
- Use an end of line to separate table cells.
- Suppress Title/URL
- Suppresses insertion of document Title (<TITLE>) and URL in output file.
- Include HTML Link References
- Add HTML link references to the converted file.
- Include Image Alternate Texts
- Add the ALT-text of images (<IMG>) to the output file.
- Include JavaScript scripts
- Add the text (NOT result!) of JavaScript (or other scripts) to converted file.
- Support badly written HTML
- Partial support for badly written HTML documents. Use with caution!
The standard HTTX settings will be saved in the environment variables
HTTX.prefs
(for Save as text) and HTTXprt.prefs
(for Print as text).
Other options (like FORCE or INCLUDE) are managed directly from the
Plugin.
Refer to
HTTX documentation
for a full explanation of options.
AWeb plugin settings
- Default save directory
- Default directory to save the converted files in.
- Don't ask for save directory
- Don't open the save requester and save directly to the default save directory.
- Print HTTP/META header
- Add the HTTP header information and the <META> tags present in the
HTML source to the converted file.
Example of the added text:
Header:
HTTP/1.0 200 OK
Server: Netscape-Enterprise/2.01
Date: Sat, 26 Apr 1997 06:38:12 GMT
Accept-ranges: bytes
Last-modified: Tue, 15 Apr 1997 13:57:46 GMT
Content-length: 7085
Content-type: text/html
Content-Type: text/html; charset=ISO-8859-1
- Show preview of converted document
- After a document is converted it will be shown using MultiView (must be
in
"SYS:Utilities/"
drawer). After closing MultiView a
requester will ask if the document should be kept or deleted. Select Delete
and the file will be removed and no conversion informations will be shown.
Note that MultiView doesn't support VT100 cursor control sequences
used (in indentation, for example) when "optimized" ANSI mode is
enabled. See HTTX documentation for more
information.
This option is only used when saving as text.
- Show conversion report
- After converting a document, an info page containing the current HTTX
settings is normally shown. With this option you can disable this behavior
and get a warning only in errors occur.
The HTTX-AWeb settings are saved in the environment variable
HTTXPlugin.config
.
Saving preferences for HTTX works like the standard WB preference programs.
Use the "Save" or "Use" option to store data. With
"Save" the settings are stored in ENVARC:
and the
changes are permanent. With "Use" they are saved only in
ENV:
so changes are lost when you reboot. The first time you
configure HTTX you MUST use the "Save" option.
To save or print a page use the previously set menu or popup entries.
If page contains frames a requester will open. You may choose to save all
frames to a single file or use a requester to save or skip each frame.
If preview is active when saving, after conversion of any document, the
converted document will be shown and then the keep or delete requester will
be shown.
V3.0
- Rewritten configuration from scratch. Now it uses an AWNP/Reaction GUI.
- Added some more options.
- Sped up both plugins and fixed many bugs.
V2.1a
- Fixed possible problems with file names containing spaces.