Constructor
new DynamicMacroDefinition(name, makeTags)
Parameters:
Name | Type | Description |
---|---|---|
name |
String | - |
makeTags |
DynamicMacroDefinition~makeTags | - |
Example
conductor.macros["hello"] = new DynamicMacroDefinition("dynamic", (args)=> {
if (args.foo) {
return [ new Tag("s") ];
}
return [
new Tag("ch", {text: "hello, "+args.text}),
new Tag("p"),
];
});
// called like this:
// [hello text=hey] [hello foo=true]