Just Another Macro Language v3.01

. . . . . . . . . . . . . . . . . . . . . . . . for HTML

On-line documentation ... start page


is complex and there are many ways one can use it. This document is a collected help without the intent of being precise or complex. Just ideas, tricks that come from the author as well as from users. Your ideas are welcome. I assume you have already read carefully the documentation.

Table of Contents

1. Naming files

Though does not insist on file extensions it is a good practice to choose file extensions carefully and planned. I usually use the extension jam for those files that are compiled by and result a file with the same name and different extension.

The files that contain macros and are included by the jam files I call jim, as they are include files.

I usually put the jam and jim files into a directory which is different from the directory of the generated files. This directory is usually one level below the output file directory and I usually call it source.

2. Compiling projects

When I have a few jam files to compile I usually create a command file that compiles them. When there are many of them in a projetc I could use the UNIX utility make. But why use the right tool, when I have some thing less appropriate? I use instead. I have a project where I craft some jam files and they each have to be compiled by to html one directory higher. I create a file named build.txt with the following content:
{#define jamal=perl ../../progs/perl/jamal/jamal.pl}
{@dir/./-f *.jam/
{#if|{#>= {#-t {$file$name}} {#-t ../{$file$nam}.html}}|\ 
{jamal} -m macros.jim {$file$name} ../{$file$nam}.html|}
I use a command procedure that compiles build.txt using and then executes the resulting command procedure. The result is each time a command procedure that compiles only those modules that were changed since their corresponding last compilation. Simple? No. But I like it.

3. Including HTML BODY

Many times we create HTML pages using some template. In such a situation each jam file looks like:

 text of the page


where the macros are defined in a separate jim file and are included using the -m command line options. This gives a frame to the content opening the page and closing the page.

But there is another way. Sometimes you just can not afford to have those two macros at the start and at the end of the file. Imagine an example, where a program generates a text file and you wan to convert it to HTML using . You might not force the program to use those macro lines. The solution is to include the file into a jam file using the include macro. But create only one jam file including the others, like

{#include {CurrentFile}}

and compile it using the command
jamal -DCurrentFile=file.jim main.jam file.html

This is when the small fish eats the big one.

4. Infinite looping

Want to drive into infinite looping? Simple:

{@define a={a}}{a}
This is when eats processor.

You are free to use and distribute as far as your actions are in line with the GNU General Public License. I would also appreciate if you could include a reference text on one or more of the pages that you create on a site using . This can be done using the predefined macro {reference}.
This page was created using jamal v3.01