3 ms·
What does the % operator formally do? All I could find in the documentation was : > Earl Grey's % operator can be used to easily build HTML, DOM, virtual DOM,
by visarga 12y ago
What does the % operator formally do? All I could find in the documentation was :
> Earl Grey's % operator can be used to easily build HTML, DOM, virtual DOM, and other things:
- breuleux 12y agoThere are examples below that statement for common usage, but if you want a deeper understanding: tag.xyz % property = value child1 child2 Will produce the data structure: {tags = {"tag", ".xyz"} props = {property = value} children = {child1, child2}} as an instance of the ENode class. Then, transformer functions can process the data structure to generate HTML or other things, e.g. require: /html html(thing) ==> <tag class="xyz" property="value">child1child2</tag>