On 8/02/2023 05:32, Peter Dimov wrote:
Yes, https://github.com/mustache/spec. Since all reference input data is in JSON format, it follows that JSON is the canonical data source for Mustache.
Technically, the specified input format is not JSON, but JavaScript objects -- hence allowing additional things beyond JSON such as lambdas. (Personally, I feel like the lambda support is misplaced -- instead of supporting lambdas in the input document it should support lambdas in the partials instead, keeping presentation separate from data. I understand why it doesn't, given that the default implementation assumes each partial is a dumb file; but Boost.Mustache doesn't have that limitation and could do better...) Mustache also has a canonical output format -- it is intended only to output as HTML and nothing else, since by default it incorporates HTML escaping rules (although that can be selectively disabled, so *technically* it can be abused to output other things). I kind of feel like a more general-purpose templating language might be more useful, but I don't have any particular preference and I don't regard this as a valid reason for rejection.