-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding the ability to select list items in the context by index. #143
base: master
Are you sure you want to change the base?
Conversation
This matches the behavior of JS implementations of mustache. Tested against mustache.js and Hogan. >>> context = {"data": ['one', 'two', 'three']} >>> pystache.render("{{ data.0 }}", context) 'one'
Is this a duplicate of issue #134? |
@cjerdonek I haven't actually tried the syntax in #134, but I'd imagine that this solves that as well. |
I think checkin 316c9d4 to support element cherrypick by index with syntax "{{array_key.index}}" is very important feature for this project. Without this feature, some data could not be rendered from array. If you try http://mustache.github.io/#demo, you could find that javascript library has already supported this syntax. |
This has not been added yet? |
👍 Very important and interesting feature indeed! |
I would like to have this functionality as well. |
Hi @cjerdonek can this be merged please? |
I too would love to have this merged in. Any chance that this project will be updated ever again? |
Any reason why this hasn't been merged? |
@cjerdonek is this repo (and this useful PR that it contains) no longer being maintained? |
I would like this feature as well. |
but also would be nice to access the last element as a function
|
This matches the behavior of JS implementations of mustache. Tested
against mustache.js and Hogan.
Tests added and all previous behavior maintained.