HTMEPM 0.99


Index

Introduction

Back in 1995, I wrote the first version of the HTML extensions for EPM so I could use my favourite editor to create HTML documents. I released updates till I felt there was no demand for non-wysiwyg editors, though I continued to further develop it for my own use. Some months ago some people (specially Daniel Hellerstein) wrote messages in comp.os.os2.apps suggesting they will wellcome a new version of HTMEPM, so I decided to polish the code, add several features,... and release a new version.
While HTMEPM98 was a simple update of previous versions (95, 96 & 97), HTMEPM99 represents a complete rewriting of the program. The major change is the use of "macros" written in C (available with EPM 6.xx versions). It is possible now to use the standard OS/2 facilities (standard and custom dialog windows, INI files, DDE, ...) from the user E macros calling C functions placed in DLLs.

Some of the features of the new version are:

Back to Top

Installation

Back to Top

Using HTMEPM

The use of the HTMEPM extensions should be intuitive to anyone familiar with the HTML tagging. The different tags that constitute the HyperText Mark-up Language can be embedded in the text selecting the HTML tag from the new menu items that have been added to the editor main menu. If the tag to be inserted is a single one (new paragraph, horizontal rule,...) it is inserted at the cursor. If the tag is "double" (i.e. it needs a start tag and an end tag) then if there is no text area previously selected both tags are inserted at the cursor position and the cursor placed between the tags; if text is selected the tags will (usually) be placed encircling it and the cursor will be placed following the ending tag.
Some options of HTMEPM may need further explanation:
Pop-up Menu
Rigt-clicking will bring up a menu with several of the HTML options directly available. If you dont't like it or wants to retain the standard EPM pop-up menu check the corresponding option in the User Preferences Dialog.
Keyboard short-cuts
By default, HTMEPM99 defines several shortcuts, and redefines F2 to save & view. They are enabled by EPM when the file being edited ends in .htm, .html, .shtm or .shtml. If you don't want the new keyboard mapping, check the corresponding option in the User Preferences dialog. You have to close and then reopen the current file to remap the keyboard.
New Document
The New HTML Doc item offers three different possibilities:
Setting Hyper-Links
When the Link to option is selected a list of different "destinations" is presented: the anchor in this page option presents you with the list of the existing anchors in the page (the page is previously automatically saved). If there are no anchors in the page you are still offered the possibility of writing a non-existent anchor name as destination (it is up to you to create the missing anchor so there are no links to non-existent targets).
When the Local file option is selected a Dialog Window shows in its upper part the resulting TAG that it is updated whenever you modify any of the options available in the Dialog window: you can select a file using the standard OS/2 File Dialog, and if there are targets in this file they are shown as selectable targets in a listbox. You can also enter directly a target, even if it does not exist (beware of missing targets) , and you can also select the way of addressing the destination file: relative addressing to the current directory, absolute addressing or use the alias concept.
The Alias concept: it allows the use of an alias for naming a directory. Let's say you give the alias name "samples" to your directory d:\httpd\docs\samples\ . If you select (in the local file dialog window) the file d:\httpd\docs\samples\demo.html and the Alias Addressing, the link will point now to samples/demo.html.
Inline Images
As in the link to local file dialog, the resulting tag is shown and continuously updated. The options available should be easy to understand. There is a checkbox to select whether you want (or not) the image file copied to the current directory. You can edit manually the resulting tag before inserting it into your file if you select the OK & Edit option.
Tables
There are two options available for tables:
  1. if you select the Create Template item a dialog window is presented, allowing to select the number of columns and rows, the use of a caption, the border width, align, cellspan, cellpad,... If you check the Width option the WIDTH option will be included in the TABLE tag with the value selected. If you check the verbose option, a comment indicating the row and column number will be inserted at the correct place. Once you press the OK button the HTML code for the empty table will be inserted.
  2. the From comma separated values option generates html tables using data exported from other programs that conforms to a comma separated value format. To use it the data must be selected previously by mouse dragging, then the option selected; a dialog window will allow the selection of several options. When you press OK the data are commented out, and the HTML code for the table with the data inserted. If a caption for the table is wanted, it must be the first line of the selection.
    An example will help to clarify the use: Before calling the table option:
    table caption
    *,First Col,Second Col,Third Col
    Row1, 23, 34, 45
    Row2, 12, 23, 34
    
    After invoking the From comma Separated Values option, the code will be <!-- table caption --> <!-- *,First Col,Second Col,Third Col --> <!-- Row1, 23, 34, 45 --> <!-- Row2, 12, 23, 34 --> <TABLE BORDER="01" ALIGN="BOTTOM" CELLSPACING="02" CELLPADDING="02" WIDTH="080%" > <CAPTION ALIGN="BOTTOM"><FONT SIZE=+1 SIZE=+1><B>table caption</B></FONT SIZE=+1></CAPTION> <TR><!--- Row 1 --> <TD> <!--- Row: 1 Col: 1 --> <TD>First Col <!--- Row: 1 Col: 2 --> <TD>Second Col <!--- Row: 1 Col: 3 --> <TD>Third Col <!--- Row: 1 Col: 4 --> <TR><!--- Row 2 --> <TD>Row1 <!--- Row: 2 Col: 1 --> <TD> 23 <!--- Row: 2 Col: 2 --> <TD> 34 <!--- Row: 2 Col: 3 --> <TD> 45 <!--- Row: 2 Col: 4 --> <TR><!--- Row 3 --> <TD>Row2 <!--- Row: 3 Col: 1 --> <TD> 12 <!--- Row: 3 Col: 2 --> <TD> 23 <!--- Row: 3 Col: 3 --> <TD> 34 <!--- Row: 3 Col: 4 --> </TABLE> and when rendered the table will look like this:
    table caption
    First Col Second Col Third Col
    Row1 23 34 45
    Row2 12 23 34

Previewing the page
HTMEPM99 uses two different methods to preview the HTML code: the first method View with Explorer creates a window that shows the aspect of the page using the WebExplorer rendering engine. Since developpement of the WebExplorer was stopped years ago, many HTML 3.2 features are not recognised (frames, java, ... ) and it will not be updated.
The other method View with Netscape uses Netscape/2. The Navigator should be running, and the EPM editor will communicate with it via Dynamic Data Exchange (DDE), making it load and show the file being currently edited in EPM.
The View with Netscape will make Netscape load the file with the name of the file you are currently editing with EPM. It does not save the file, so Netscape loads the file from the disk and shows the currently saved file.
The Save and View option allows the saving and previewing of the current file by pressing a single key (F2) Note that this will only work if the file ends in htm, html, shtm or shtml. For other files to be sent to Netscape you will have to use the menus.
HTML Reference
This option simply calls the standard OS/2 view program passing it as parameter HTMLREF, so you need to have an INF file called HTMLREF.INF somewhere along the paths pointed by BOOKSHELF in your config.sys. My recommendation is that you download the HTML 3.2 and 4.0 references from the Web Desing Group website These are the direct links:
Once downloaded, unzip them and copy the selected one (3.2 or 4.0) to somewhere along the BOOKSHELF and rename it as HTMLREF.INF .
You can also define HTMLREF in your CONFIG.SYS as a set of files:
SET HTMLREF=html32+html40+cssos2
then when invoked from EPM, view will load ALL the files defined.
Registration
The program is freeware for non-commercial or educational use. Otherwise, registration will cost 25€ Euros. To register, please contact me : areitio@ibm.net

Eduardo Areitio
Bilbao, Spain