In particular, each list beginning with a keyword is transformed into an (X)HTML tag. It is an easy way to handle all current and future HTML elements without defining a function for each element and their attributes. You might be thinking: "we could generate invalid HTML", and yes, it is true. Other libraries exist to generate HTML, but this one is quite popular.
The other interesting thing is that by processing the tree at compile time, you can make some optimizations.
For example, the following form:
In particular, each list beginning with a keyword is transformed into an (X)HTML tag. It is an easy way to handle all current and future HTML elements without defining a function for each element and their attributes. You might be thinking: "we could generate invalid HTML", and yes, it is true. Other libraries exist to generate HTML, but this one is quite popular.
The other interesting thing is that by processing the tree at compile time, you can make some optimizations. For example, the following form:
... is expanded as: ... because it does not depend on external data. However, if instead of a constant string, you place (str (something)), you have instead: