Marks Macros for EPM

Here another set of HTML macros for EPM. Like those before Me, I've built upon the ideas of my predessors, making them a little better (I hope). Thanks to those who have done the work upon which I built. Special thanks to the Web Design Group for creating the INF documentation Included.

Features

  1. Keystrokes to enter tags.
  2. Drag & Drop for URL objects, HTML files, images and Java classes.
  3. Help menu additions for HTML documentation.
  4. Defaults for tag arguments saved with each individual file.
  5. Navigational assistance.
  6. An optional Toolbar
  7. An improved EPMKWDS.HTM
This is 3.2 compliant, no Frames, no Blink or any other jackass tags.

Installation

Cautionary notes

This file can be compiled as part of a larger package or as a linkable module. Because of the Kludgy way I handled URL's with the data type UniformResourceLocator, it isn't recommended that it be compiled as part of your basic EPM package without setting HTML_URL_KLUDGE to 0. In rare circumstances this can cause problems. Because these macros use the field variable .userstring they shouldn't be compiled in any package where it might also be used.

Installation (really)

Where the files should go

It depends. I wrote these under version 603b, and haven"t tried them under earlier versions, and the paths are from the EPM6 version. If you don't have it you might as well get it, it's free.
The files htmlkeys.e and htmlconst.e should go in in the directory X\:EPM6\MAC, or whatever directory you have all your *.e files. The *.erx files should go in X:\EPM6 or wherever you have all your *.erx files. The file wilbur.inf should go somewhere in the path described by your BOOKSHELF environmental variable (or you could change the variable). The Rexx *.cmd files should go somewhere in your PATH

Paths

If you haven't set your EPMPATH in your CONFIG.SYS, do it.

Compiling it

Edit the file WEBOPTIONS.E to suit your installation.

The Variables are:
JAVA_HTML_BROWSER
Fully qualified path to your browser (or just the name if it is in your PATH) and switches.
HTML_IF_ARG_BLANK
Set this to "exit" if you want to abort a tag when mandatory arguments are not entered, otherwise you will be re-prompted
HTML_URL_KLUDGE
Set to 0 to turn off the URL kludge.
Linkable
Just type etpm htmlkeys and when you are ready to use it, from the command window type link htmlkeys
As Part of a Larger Package
Enter the line include 'htmlkeys.e' in your MYSTUFF.E file and at the command line in the EPM directory type etpm package, and you're ready to go.

Use

Keyboard Entry

Most of the CTRL, ALT and F* keys have been overridden to be shortcuts for tag entry. You can find out which does which by looking at the menu or HTML Keys Cheat Sheet. Some tags will check to see if there is any text marked on on the screen. If there is, it will be surrounded by the tag. Otherwise they will be placed adjacent to one another with the cursor between them. Tags that normally occupy more than one line are inserted with opening tag where the cursor is. a blank line below it and the closing tag following the blank line and the cursor placed between the tags at .col=1.

If a tag has arguments you will be prompted for the values. If you enter a blank for a mandatory tag you will be prompted for the correct value or the tag will be aborted depending upon your configuration. You can also abort a most tags by choosing Abort on the diaolg box. This doesn't work with entryboxes where a numerical value of 3 might be entered (That's what the abort key returns). On these you can abort by entering #OOPS when prompted.

International and special characters are on the menu. They can also be entered from the keyboard. To do so: The case of tags can be toggled with the Toggle Case menu item.

Drag & Drop

All path separators are converted to UNIX style

If the leading path of the file being edited is the same as that of a dropped object the portion that is identical will be removed from the tag, creating a relative URL.

For Example:

If you are editing a file e:\foo\myfile.html and drop the file e:\foo\bar\a.gif, the path for the gif that will be entered is /bar/a.gif.

HTML files

The Macros will scan the first 10 lines for a <TITLE></TITLE> pair and uses that for the text of the link.

URL's

Dropping a URL will create a link, using the name of the object for the text of the link.
For some reason EPM doesn't recognize data types of more that 18 characters, which is problematic for the data type UniformResourceLocator. I created a kludge to get around this. It decides a file is a URL if it is only one line long and the text looks like a URL. This kludge can be turned off by setting HTML_URL_KLUDGE to 0 in your WEBOPTIONS.E file

Java classes

When you drop a Java class the EA's of the class are scanned for the arguments and parameters which are then placed in the tag. These can be set using the included the Rexx script CLASSEA.CMD Just type at the command prompt

classea [filename]

and follow the prompts. If anyone out there knows where I can find some public Java classes for EA manipulation let me know, so I can make a nifty Java application to do this.

Images

These macros recognize JPEGs and GIFs. You can set the default values for the tag arguments for each image with the script imageEAs.cmd just like you do with Java classes. Don't worry about setting the height and width for GIFs, those values will be taken from the files.
GIFs
The width and height will be taken from the image and automatically entered in the tag.
JPEGs
If I can ever figure out how to do so with JPEGs it will be done for them as well.

XTML

XTML is a file extension I made up for importable files (something that should be part of the standard). It is a good place to put indices and maps. When you drop one you will be prompted as to whether you want to load or import it.

Tabbing

The CTRL-TAB and SHIFT-TAB keys have been redefined to searchthe line places likely to need text entered. If no such place is found the cursor is placed at the end of the line. If it starts at the end of the line it goes to the next line. CTRL-TAB scans right and down and SHIFT-TAB scans left and up.

Viewing a file being edited

Choose View File from the menu. The file will be saved under a phony name and your browser will be launced with that file.

Setting defaults

The default argument's can be set by choosing the option from the interface sub menu. You will be prompted for the argument to default and then the value of the argument. This value will appear in entryboxes or at the top of listboxes, as appropriate. If the value you enter or choose is preceeded with AUTO_ you will not be prompted for the argument.

Care should be taken when using the AUTO_ feature. If you do not have HTML_IF_ARG_BLANK set to exit you can get stuck in infinite loops if you set AUTO_(some invalid value) value for mandatory arguments. I think I error trapped all instances where this is possible but I'm not sure

The defaults are automaticaly loaded into an array when the file is loaded. If you change them the changes only reside in the array until you chose Save Defaults. The array is not automaticaly saved with the file. Clear defaults clears the array Load Defaults restores them from the last save.

Changes to the defaults are not undoable. You have to change then again manually.

Known bugs and miscellaneous stuff

I know of no actual bugs. The way I had to handle URL's with the Data Type UniformResourceLocator is the only problem. EPM only seems to recognize data types of 18 or fewer characters. If anyone can figure more elegant solution than what I'v done please tell me.

I thought about adding a table formatting routine but it required so many special markers that it was no easier than just entering the tags.
I'm not fool enough to think that there is any way I can enforce any kind of shareware payment scheme. If you find these useful contribute what you consider to be a fair amount to my Internet account. Send a check to:
CTS
8913 Complex Dr
San Diego CA U.S. 92123-1413
with a note telling them to credit the edantes account. And, of course, anyone can distribute it as long as they don't modify the contents

Send questions, comments. adulation, and bug reports to edantes@cts.com

No Warrantee: This is available 'As Is'. If anything bad happens to you I'm not responsible, whether or not you are using this procuct.