mem4 - The HTML Macro Processor

mem4 processes macros embedded in HTML files.

SYNOPSIS

    java mem4 filename > outfile

DESCRIPTION

mem4 is the HTML Macro Processor written in the Java language.

The filename argument is the name of a file that contains special mem4 macro directives embedded within HTML. By default mem4 writes its output to the standard output stream. To cause mem4 to write an output file instead, redirect its output to a file. Although mem4 doesn't require it, your input files should have a .mem4 filename extenstion, and your output files should have a .html filename extension.

MACROS

Defining a Variable

mem4 let's you define and use variables. To define a variable:
    #define VARIABLE value
When defining a variable:

Using a Variable Definition

To use a variable:
    $VARIABLE
You can use a variable Note: you can redefine a variable simply by defining it again. Note: if you really want the string $VARIABLE to be in the result use '\' to escape the variable name. For example: $\VARIABLE yields $VARIABLE in the output.

Note: if you reference a variable that has not been defined the variable name is used as its value. For example, if VARIABLE had not been defined, $VARIABLE would yield VARIABLE in the output.

Note: you can't concatenate the value of a variable with regular text. For example, if you use $VARIABLEsometext mem4 will actually look up VARIABLEsometext in its dictionary, rather than concatenate the value of VARIABLE and the following text. In other words the variable name must be followed by a non-alphanumeric character that separates it from whatever follows it.

Including Files

mem4 let's you include the contents of other files. To include a file:
    #include filename
When including files:

BUGS

Need to allow users to concatenate a variable with regular text. One possibility is to use the '\' character to separate the variable name from the text, so that: $VARIABLE\sometext yields valuesometext.

STAY TUNED FOR

#include features

Ability to extract lines from an included file.
Ability to make certain lines from an include file bold.
Ability to make certain lines from an include file italic.

#undefine features

Ability to undefine variables.