noahmorrison / chevron

A Python implementation of mustache
MIT License
486 stars 52 forks source link

Accessing nth element of array #52

Closed alanyee closed 5 years ago

alanyee commented 5 years ago

The feature is present in other language implementations of mustache like JS, but it does not seem in this one.

Ideally, we can get something like

>>> chevron.render('Hello, {{ mustache.0 }}!', {'mustache': ['World']})
'Hello, World!'
noahmorrison commented 5 years ago

Dan managed to implement this before I even saw it :stuck_out_tongue:

This seems useful, kinda weird it's not part of the spec. It's already on master, I'll push a new PyPi version this weekend.

jeffbryner commented 4 years ago

Any chance @noahmorrison this could get pushed to a release? pypi version doesn't have this feature and it would be handy!