kt Html
fun OutputPath.ktHtml(source: Path, context: Map<String, Any?> = emptyMap(), includes: List<Path> = this.includes): <Error class: unknown class>
Template the source file using the <?kt ... ?> syntax. For example,
<p><?kt (1..5).joinToString("\n") { "<a href='hi$it'>hi#$it</a>" } ?></p>Content copied to clipboard
results in
<p><a href='hi1'>hi#1</a>
<a href='hi2'>hi#2</a>
<a href='hi3'>hi#3</a>
<a href='hi4'>hi#4</a>
<a href='hi5'>hi#5</a></p>Content copied to clipboard
You can pass global variables into the templates with context.