
Just Another Macro Language v3.01. . . . . . . . . . . . . . . . . . . . . . . . for HTMLOn-line documentation ... start page
TIPPS
Table of Contents1. Naming filesThough 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 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 projectsWhen 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 BODYMany times we create HTML pages using some template. In such a situation
each jam file looks like:
{TemplateStart}
text of the page
{TemplateEnd}
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
{TemplateStart}
{#include {CurrentFile}}
{TemplateEnd}
and compile it using the command
jamal -DCurrentFile=file.jim main.jam file.htmlThis is when the small fish eats the big one. 4. Infinite loopingWant to drive into infinite looping? Simple:
{@define a={a}}{a}
This is when eats processor.
You are free to use and distributeThis page was created using jamal v3.01 |