This page obtained with the m4ml translator

The m4ml translator

This document was obtained from a source file through the Bourne shell script m4ml.

This is accomplished in two phases:

Phase 1.
A header file is first added in front of file welcome.m4ml and piped through the general purpose macro preprocessor m4 (see the corresponding documentation: man m4). This kind of preprocessing is also suggested by the WebTechs team. The aim of the header file is to provide a set of useful predefined macros, and to rename some of the m4 standard macros that correspond to common english words, so as to avoid the need of quotation. In particular:
define   --> _define_
include  --> _include_
...
Phase 2.
The result of Phase 1 is then piped through the Multilanguage engine ml in order to obtain one or more html files.

Transition from an html file

The first step is simply to rename <file>.html into <file>.m4ml and try to compile the result with m4ml <file>. It is recommended to first copy the original html file to a backup file in order to check that the result of the compilation leaves the file intact. Note that some characters and words now have special meaning, such as the left and right single quote, which are the quotation character for m4, and the character %, if it appears as the first character of a line, which has special meaning for ml.

At this point it is possible to add any m4 macro command, or macros defined in the header file, for example:

_include_(filename)
_define_(_ICONS_, /~user/images)
<img src="_ICONS_/home.gif">
Here is a brief list of predefined macros:
_SERVER_
the URL of the local http server; e.g. http://www.dmf.bs.unicatt.it.
_HOME_
The path of the current directory; e.g. /home/matem/paolini.
_LPATH_
The path of the current directory, starting from the user html base directory (public_html); e.g. /varie.
_USER_
The username corresponding to the command whoami; e.g. paolini.
_INCDIR_
The path of a directory containing m4 include files; e.g. /home/matem/paolini/public_html/include.
As a rule, all predefined macros are strings surrounded by the underscore character, to prevent accidental correspondance to normal english text. To prevent evaluation of a macro, it must be surrounded by left and right single quotes, as in `_USER_'.

ml usage

The main purpose of ml is to allow creation of parallel files in different languages (or different styles) starting from a single file. The source file starts with a header defining all the files to be created. If the header is missing, then a single file will be created, with the same name of the originating file, and extension html. The complete syntax is described in the beginning of the source file multilang.c, here are a few examples:
    %ita$f:%s.html
    %eng$f:%s_%k.html
    %fra$f:%s_%k.html
    %%end
In this example, three files will be created, with names <file>.html, <file>_eng.html and <file>_fra.html, and the keywords ita, eng and fra are associated to each file.

Normally, each line of text following the header will be copied into all files, with the exception of lines starting with the percent (`%') character. Examples:

   %ita:Questa linea viene scritta nel file <file>.html
   %eng:This line will be copied in file <file>_eng.html
This is a more sofisticated example:
   %!ita$h:Disponibile in <a href="%s">italiano</a>
This line is written in all files with the exception of <file>.html (corresponding to the keyword ita. The specifier `h' following the dollar sign substitutes the filename corresponding to the keyword ita in place of the subsequent appearance of %s.
   %$d:Last updated: %s.
Substitutes the current date in place of the %s.