m4ml
.
This is accomplished in two phases:
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_ ...
ml
in order to obtain one or more html files.
<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_
http://www.dmf.bs.unicatt.it
.
_HOME_
/home/matem/paolini
.
_LPATH_
public_html
); e.g. /varie
.
_USER_
whoami
;
e.g. paolini
.
_INCDIR_
/home/matem/paolini/public_html/include
.
`_USER_'
.
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 %%endIn 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.htmlThis 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.