< Style sheet references | Marker exceptions and raw text > |
Macros are a “named” portion of text. Once defined, their content is printed each time the name is referenced in the document. A macro definition starts with the “:macro” command and ends with “:/macro”. To reference a macro, its name is written between double parenthesis “(())”.
:macro confidential
//This is confidential information!//
:\macro
:h2 Layout
((confidential))
The layout consists of lots of information [...]
:h2 Interface design
((confidential))
The interface allows to connect to the system in several ways. [...]
This is confidential information!
The layout consists of lots of information [...]
This is confidential information!
The interface allows to connect to the system in several ways. [...]
Macros can be used to form seperate paragraphs (as seen above), but also inline:
:macro hithere
**Hi there!**
:\macro
He said: “((hithere))”
He said: “Hi there!”
Macros can take parameters. The macro definition names them in the “:macro” line right to the macro's name, seperated by the vertical bar, “|”. The macro body references them by their name in double curly braces, “{{}}”. When calling a macro, the parameters values are written into the double parenthesis together with the name, seperated also with “|”. A macro parameter can on its own contain any STML elements, including paragraphs with any layout, style sheet references, and even other macro calls.
:macro comment|text
//({{text}})//
:\macro
:macro role|speaker|text
**{{speaker}}**: {{text}}
:\macro
:h2 Capulet's orchard. (Short version)
((role|Juliet|((comment|At window)) It was the nightingale, and not the lark.))
((role|Romeo|It was the lark, the herald of the morn; No nightingale. I must be gone and live, or stay and die.
Bye. ((comment|off))))
Juliet: (At window) It was the nightingale, and not the lark.
Romeo: It was the lark, the herald of the morn, no nightingale. I must be gone and live, or stay and die.
Bye. (off)
Macros, macro calls and parameters inside macros and macro calls are semantic entities on their own. Macros and macro parameters enclose everything defined in them. At the end of a macro, all environments (like italic or “:div” sections) are closed implicitly. This means for example, that you cannot close an italic section in a macro body which has been opened beforehand outside the macro.
It is possible to define macros document-globally in the global macros editor. Those macros can be used in every section of the whole document.
< Style sheet references | Marker exceptions and raw text > |