Simplify HTML DSL
Pre-release
Pre-release
With this release we have redesigned and simplified our HTML DSL so that:
// Old DSL style
Kweb(port = 1234) {
doc.body.new {
ul().new {
li().text("One")
li().text("Two")
li().text("Three")
}
}
}
Becomes:
// New DSL style
Kweb(port = 1234) {
doc.body {
ul {
li().text("One")
li().text("Two")
li().text("Three")
}
}
}
Note that elements and their children can now be created without the new {}
function - although it is still available for when you need to add children to a pre-existing Element
, so existing code shouldn't require significant changes.
Please take a look at our user manual to learn more about Kweb.