Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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 a JTE reporter #8842

Open
mnonnenmacher opened this issue Jul 4, 2024 · 4 comments
Open

Add a JTE reporter #8842

mnonnenmacher opened this issue Jul 4, 2024 · 4 comments
Labels
new feature Issues that are considered to be new features reporter About the reporter tool

Comments

@mnonnenmacher
Copy link
Member

mnonnenmacher commented Jul 4, 2024

Add a JTE template reporter as an alternative to the Freemarker template reporter.
In constrast to Freemarker, JTE supports Kotlin expressions in templates which would make it easier to call Kotlin code from the templates without having to learn another syntax.

@mnonnenmacher mnonnenmacher added new feature Issues that are considered to be new features reporter About the reporter tool to triage Issues that need triaging labels Jul 4, 2024
@sschuberth sschuberth removed the to triage Issues that need triaging label Aug 13, 2024
@sschuberth
Copy link
Member

It would be awesome of this allows us to get rid of the overly complex FreemarkerTemplateProcessor which basically just makes the Kotlin models more accessible from Freemarker.

@sschuberth
Copy link
Member

sschuberth commented Oct 31, 2024

make it easier to call Kotlin code from the templates without having to learn another syntax.

But isn't it so that e.g. control structures still require JTE syntax, like @for etc.? Because of that, just to document the idea, I was wondering whether we could instead simply create a Kotlin script reporter that returns a (huge) string which gets expanded / interpolated by standard Kotlin functionality.

@mnonnenmacher
Copy link
Member Author

But isn't it so that e.g. control structures still requite JTE syntax, like @for etc.?

Yes.

Because of that, just do document the idea, I was wondering whether we could instead simply create a Kotlin script reporter that returns a (huge) string which gets expanded / interpolated by standard Kotlin functionality.

This is definitely also an option. It's somehow the opposite approach to template engines. With template engines you write the template in the native output format like Markdown and inject some code here and there, so the "main" syntax of the template file is that of the output format. With the Kotlin script approach the code part becomes easier, but it becomes harder to ensure that the syntax of the output format is followed (expect when a DSL for the format is available).

@sschuberth
Copy link
Member

With the Kotlin script approach the code part becomes easier, but it becomes harder to ensure that the syntax of the output format is followed (expect when a DSL for the format is available).

True. Maybe IntelliJ language injections could help here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature Issues that are considered to be new features reporter About the reporter tool
Projects
None yet
Development

No branches or pull requests

2 participants