Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add kotlin and kte documentation #351

Closed
checketts opened this issue Apr 20, 2024 · 1 comment
Closed

Add kotlin and kte documentation #351

checketts opened this issue Apr 20, 2024 · 1 comment

Comments

@checketts
Copy link
Contributor

checketts commented Apr 20, 2024

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

  • Non-null parameters missing from a template (error isn't clear, but recognizable once it is known)
  • Null lists in a @for block error messages
    4- Sub-tempate syntax:
!{val subTemplate = {name -> @`<div>Hello ${name}!</div>`}}
${subTemplate("World")}
${subTemplate("JTE")}

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

@casid
Copy link
Owner

casid commented Apr 22, 2024

Welcome @checketts!

Thanks for sharing your experience, that sounds great.

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

checketts added a commit to checketts/jte that referenced this issue Apr 22, 2024
casid pushed a commit that referenced this issue Apr 26, 2024
* Solves #351 - Add kotlin docs

* Fix doc typos
@casid casid closed this as completed May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants