Wusage 8.0 ManualReport Macro LanguageThe report macro language is designed to be simple and straightforward, but most users will not need to fully understand it in order to make useful changes, such as translation or aesthetic improvement. Complete understanding of the report macro language is only necessary for those who wish to reorganize the reports in dramatic ways. "How do I get started?"A collection of standard report macros are used to generate all of the normal HTML and email reports of Wusage 7.0 and above. Normally, these macros are fetched from an internal copy. However, users who wish to do so can easily replace them.
You can also create customized macros for individual report directories by placing those macro files directly in the report directory itself. As a rule, if a report macro file can be found in the report directory, that file is used instead of the wusage-macros directory. If a report macro file
cannot be found in either location, the built-in version is used.
Once you have copied the
As a general rule, if you prefer not to learn the report
macro language, don't change any portion of the "How does the report macro language work?"Anything that appears in a.rmc file is considered
to be HTML (or EML for email reports), and is output
directly as part of the report, unless it appears between
the [@ and @] markers.
"What can appear between
The following commands can appear immediately following
the |
Command | Syntax | Meaning |
---|---|---|
set |
[@set macroname macrovalue@] |
Sets the named macro to the specified value. The value
can extend for as many lines as the author desires. Once a
macro has been set, it can be expanded using the syntax
[@macroname@] . A macro cannot have the same
name as a command. If a macro is set twice, the new
value replaces the old value. |
unset |
[@unset macroname@] |
Unsets the named macro. The macro no longer has a value.
The ifset command will consider it to be unknown. |
ifset |
[@ifset macroname text@] |
If the named macro is set, then the text will be inserted
into the report. The text can extend for as many lines as desired.
If the macro has been unset using the unset command,
the text is not inserted. |
ifunset |
[@ifunset macroname text@] |
If the named macro is NOT set, then the text will be inserted
into the report. The text can extend for as many lines as desired.
If the macro has been unset using the unset command,
the text is not inserted. New in 8.0. |
openfile |
[@openfile filename@] |
The specified file is created, and all subsequent report
text is written to that file instead of to the original report file,
until the closefile command is used, or until the
openfile command is used again. The openfile
command does not nest; that is, if you open one file, then open another,
and then use the closefile command, you are now writing
to the initial report file. |
closefile |
[@closefile@] |
Closes a report file opened by [@openfile@] . Subsequent
output is written to the initial report file.
|
include |
[@include filename@] |
Reads additional text and/or macros from the specified file, exactly as if the contents of the file appeared at this point in the original report macro file. This facility provides a way to break up a complicated report macro file into several files. |
open |
[@open@] |
Inserts the literal characters [@ into the
report. This is an "escape mechanism" for those who must use
the string [@ for some other purpose.
|
close |
[@close@] |
Inserts the literal characters @] into the
report. This is an "escape mechanism" for those who must use
the string @] for some other purpose.
|
jsq |
[@jsq macroname@] |
The text of the named macro is inserted into the report in a format compatible with Javascript quoted strings. That is, the " character is escaped as \", and the \ character is escaped as \\. The 8.0 versions of the documents and directories reports use this feature to store those reports very efficiently in arrays of Javascript strings. |
Boutell.Com, Inc.
PO Box 16716
Seattle WA 98116
USA
+1 206 658 8176