I am using the Mustache templating library and trying to generate a comma separated list without a trailing comma, e.g.
red, green, blue
Hrm, doubtful, the mustache demo pretty much shows you, with the first property, that you have to have the logic inside the JSON data to figure out when to put the comma.
So your data would look something like:
{
"items": [
{"name": "red", "comma": true},
{"name": "green", "comma": true},
{"name": "blue"}
]
}
and your template
{{#items}}
{{name}}{{#comma}},{{/comma}}
{{/items}}
I know it's not elegant, but as mentioned by others Mustache is very lightweight and does not provide such features.