ktHtml

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>

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>

You can pass global variables into the templates with context.