WebAssembly
Wrapper module for assembling html elements from blocks into iolist.
The moving parts are: elements DSL (WebAssembly.DSL), HTML macros (WebAssembly.HTML) and a context in which they should be used, provided by Builder (WebAssembly.Builder).
These modules are automatically imported, so you just use:
use WebAssembly
builder do
div class: "container" do
n = get_the_size
if n > 1 do
ul do
for index <- 1..n, do:
li "item #{index}"
end
else
span "got only one item"
end
end
end