This works fine, iterating over the elements in an array:
data = {arr=[10,20,30]};
template = "{{##arr}}{{.}}{{/arr}}";
writeOutput(mustache.render(template, data));
How can you show just element 2, say? Not with any of these seemingly intuitive constructs:
template = "{{arr.2}}";
template = "{{arr[2]}}";
My actual use case is more like this:
data = {arr=[{a=10, b=11}, {a=20, b=21}]};
template = "{{arr.2.b}}"; // or whatever would work to output '21'
The similar case of addressing a specific struct item does work, for instance:
data = {s={a=10, b=20, c=30}};
template = "({{s.b}})"; // -> '20'
Is the array element index version of this possible today with some syntax I missed?
If not, is it a reasonable enhancement?
Thanks.