
Here are some examples of macro definitions:<$MACROMacroName [ flags ] [ attributes ]>
...macro text...
</$MACRO>
MyAddress that only is a
shortcut for your email-address like
<$MACRO MyAddress> hugo@some.where </$MACRO>So every time, you insert the macro-tag <MyAddress> in your hsc-source, it will be replaced by
hugo@some.wherein the HTML-object.
Anyway, while other people think about which logical style should get his own tag and which not, you can define your own styles. For example, a logical style to render a filename could look like this:
<$MACRO FILE><I></$MACRO> <* enable italic *> <$MACRO /FILE></I></$MACRO> <* disable italic italic *>Your new style can be used like all other styles:
..open the file <FILE>hugo.txt</FILE> and..In this case, filenames will be rendered italic:
..open the file hugo.txt and..This seems much more reasonable to me then producing heaps of logical styles, but..
Note that you just created a container that requires an openig and closing tag.
<$MACRO BUTTON_NEXT NxtRef:uri> <A HREF=(NxtRef)><IMG SRC=":image/next.gif" ALT="Next"></A> </$MACRO>This defines a macro that defines a button that references to the next page. As every page has its own next page, you can set one attribute for this macro:
NXTREF, which is the URI that should be referenced as the "next"
page.So an example usage of this macro would be:
<BUTTON_NEXT NXTREF=":features/rplcent.html">which will give the button seen below:
Note that the value of NXTREF is passed to the HREF
attribute within the <A> tag when the macro is extracted.
If you wonder, what HREF=(NxtRef) (see above) should
mean: This sets HREF with the value stored in
NxtRef. For details, read the section about
expressions.
Macro attributes can only be defined within opening macros. The coresponding closing macro automatically inherits all attributes of its opening macro. This seems more HTML-like to me.
SGML is able to handle macros.
To make your macros more powerful and flexible, you can use expressions and conditional conversion.