casid / jte

Secure and speedy templates for Java and Kotlin.
https://jte.gg
Apache License 2.0
844 stars 63 forks source link

Add kotlin and kte documentation #351

Closed checketts closed 6 months ago

checketts commented 7 months ago

I would like to add to the documentation a section specific to getting up and running with Kotlin and KTE templates.

Points I've run into that would be good to document:

1- Kotlin templates need to be named with .kte, you can't use Kotlin code in a .jte file. 2- Add the jte-kotlin dependency using compileOnly so it doesn't bring in the Kotlin compiled (~60mb) 3- Various gotchas and error messages

!{val subTemplate = {name -> @`<div>Hello ${name}!</div>`}}
${subTemplate("World")}
${subTemplate("JTE")}

Would these additions be welcome as a new section in the docs?

casid commented 7 months ago

Welcome @checketts!

Thanks for sharing your experience, that sounds great.

Very happy to receive a PR from you for these improvements!