-
Notifications
You must be signed in to change notification settings - Fork 71
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
Feature/conditional block #22
Conversation
+1, having to make a new method for checking whether something is empty before iterating over it is quite annoying. (I hope this is what I think it is O_o) |
the way i implemented it is actually not for iteration. For iteration, usually, this should work, depending on the truthiness semantics of your implementation language
Where is clear that you want to iterate over products. I use the above for things like:
|
I've implemented the ? tag but didn't do the else. Looks like a reasonable idea to me. |
+1 |
It appears that d5c6d4e does not belong into this pull request. |
Explicit conditional blocks are e.g. necessary to support introducing the expansion of a list with an optional header, like in the following example: ```mustache {{?products}} Product names: {{#products}} - {{name}} {{/products}} {{/products}} {{^products}} No products {{/products}} ``` See-Also: mustache/spec#22 See-Also: mustache/spec#55 (comment)
Explicit conditional blocks are e.g. necessary to support introducing the expansion of a list with an optional header, like in the following example: ```mustache {{?products}} Product names: {{#products}} - {{name}} {{/products}} {{/products}} {{^products}} No products {{/products}} ``` I did not include tests, because their data is included in the corresponding pull request to the Mustache spec. See-Also: mustache/spec#22 See-Also: mustache/spec#55 (comment)
Explicit conditional blocks are e.g. necessary to support introducing the expansion of a list with an optional header, like in the following example: ```mustache {{?products}} Product names: {{#products}} - {{name}} {{/products}} {{/products}} {{^products}} No products {{/products}} ``` I did not include tests, because their data is included in the corresponding pull request to the Mustache spec. See-Also: mustache/spec#22 See-Also: mustache/spec#55 (comment)
Explicit conditional blocks are e.g. necessary to support introducing the expansion of a list with an optional header, like in the following example: ```mustache {{?products}} Product names: {{#products}} - {{name}} {{/products}} {{/products}} {{^products}} No products {{/products}} ``` I did not include tests, because their data is included in the corresponding pull request to the Mustache spec. See-Also: mustache/spec#22 See-Also: mustache/spec#55 (comment)
What was the reason for closing this? |
Just closing after 5 years to clean up my open pull request view :)
… On Aug 22, 2017, at 1:55 PM, Dennis Schridde ***@***.***> wrote:
What was the reason for closing this?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub <#22 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAH1uYpMQ5448W36uVDOk3kJr0m4en1Pks5sasGwgaJpZM4LwmW5>.
|
Shall I submit the patch in a new pull request? |
Sure, go ahead. I’m happy to reopen the pull-requests too if that is easier?
|
That would probably be easier, yes. Are you still maintaining the specification and do you plan to make changes like these? |
Oh I’m not the maintainer of mustache, and in fact I haven’t done any web development in the last 5 years. I don’t see myself working on this any time in the future either.
… On Aug 23, 2017, at 1:57 PM, Dennis Schridde ***@***.***> wrote:
That would probably be easier, yes. Are you still maintaining the specification and do you plan to make changes like these?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub <#22 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAH1uSQ7otAOh-hSe4Iw0OZcKdKNahnoks5sbBOegaJpZM4LwmW5>.
|
I'm writing a compiler, and for efficiency purposes (and also template "clarity", in that i can see when a conditional is meant rather than iteration/lambda/new context/conditional), I decided to add a {{?test}} construct that can be used for conditionals. Also allows a kind of shortcut syntax {{?test}}then{{^test}}else{{/test}}.
let me know what you think.