A macro is effectively a function called at compile time.
You can use {{name}}
to just string insert the value right there.
You can use {{children}}
to insert the child nodes of the macro invocation there.
Macros are declared by doing
macroName {
<div id="{{key}}">{{children}}</div>
}
You can call a macro by doing
<macroName() key="value"> <div> children </div> </macroName>
You must use the same keys as used in {{key}}
in the macro. Any attributes set on the macro invocation will
be passed into the macro as free variables. If a macro references any variables that are not defined they
will be defaulted to empty string
You can also require(uri)
to load any macros from that file into the current file.
If you require a file and it contains anything that's not a macro then screw that.
Such a HTML file compiles to a javascript file that module.exports = {{HTML AS STRING}}