Closed vojtechportes closed 10 months ago
+1
+1
I implemented the "key compare" as an extension in C implementation: https://gitlab.com/jobol/mustach
It allows interesting processing. The syntax there use = sign to compare equality and =! as an extension of the extension to compare to inequality.
Closing this because this repository is about the website and not about the Mustache template language. Please take comments about the template language to https://github.com/mustache/spec/discussions.
Previous discussions about this particular topic can be found via https://github.com/mustache/spec/discussions/163.
I know this is not an issue, but it would be nice to have some possibility to compare or test value when writing block and to write default value more effective way.
To keep logic-less syntax, what about something like this?
Compare:
Occurence in the string:
I think this is quite logic-less. More than that, I think that more can be improved eg for default values Because of following reasons.
Istead of writing this:
Wouldn't it be easier and more clear to have syntax like this?
I understand logic-less structure, it can be used by anyone, but sometimes this kind of "logic-less" code is really hard to read. And Im saying this as developer whose "logic-less" needs to be understand by non developers, by marketing people or designers. Such functionality I'm proposing could help a lot. I also know I can use handlebars instead, or I can modify mustache code, but I believe this shouldn't be prefered way.
Thanks in advance for considering my suggestions.