jmustache icon indicating copy to clipboard operation
jmustache copied to clipboard

Parametrized lambda support

Open jvmlet opened this issue 4 years ago • 4 comments

Is parametrized lambda supported ? Looking for something like below :

{{myLambda [param1='val1',param2=2]}}  inner  {{\myLambda}} 

jvmlet avatar Feb 15 '22 09:02 jvmlet

Handlebars allows that. If you want that look into Handlebars.java.

agentgt avatar Mar 31 '22 16:03 agentgt

Thanks @agentgt, I'm aware about handlebars

jvmlet avatar Mar 31 '22 18:03 jvmlet

Yes but your request seems kind of out of scope for a library that mostly follows the mustache spec.

Adding parameters basically makes it not logic-less and there is a library with a spec that has lambda with parameters aka handlebars.

agentgt avatar Mar 31 '22 20:03 agentgt

@jvmlet Did you ever solve your problem?

I forgot to mention you could also use Mustache Lambdas and parse the section body or do a builder approach where you return a lambda that returns an object that has more lambdas.

If you are still interested I can show the builder approach with some code.

agentgt avatar Dec 04 '23 16:12 agentgt