Skip to content

Instantly share code, notes, and snippets.

@carlosgub
Created September 21, 2019 03:55
Show Gist options
  • Save carlosgub/2c30c7cfe2b1e7a6713794d36e7d93c5 to your computer and use it in GitHub Desktop.
Save carlosgub/2c30c7cfe2b1e7a6713794d36e7d93c5 to your computer and use it in GitHub Desktop.
fun result() =
html {
head {
title {+"XML encoding with Kotlin"}
}
body {
h1 {+"XML encoding with Kotlin"}
// an element with attributes and text content
a(href = "http://kotlinlang.org") {+"Kotlin"}
// mixed content
p {
+"This is some"
b {+"mixed"}
+"text. For more see the"
a(href = "http://kotlinlang.org") {+"Kotlin"}
+"project"
}
p {+"some text"}
// content generated by
p {
for (arg in args)
+arg
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment