On Sep 17, 3:08 pm, [email protected] wrote:
> Comment #8 on issue 31 by sroussey: Implement predicates for selecting  
> sectionshttp://code.google.com/p/json-template/issues/detail?id=31
>
> I meant:
>
> {.section foo advancedSetting|true?}

I'm not sure what you're getting at here.  Can you post a real
example?  "foo" and "advancedSetting" are BOTH keys in your JSON
dictionary.

The predicate is a function which receives a JSON node.  The JSON node
is named in the section.

{.section issues plural?}
  There are {...@} issues.
{.or singular?}  # Didn't work out this syntax yet, but I'll need more
than 2 clauses
  There is one issue.
{.or}
  There are no issues.
{.end}

These are the definitions of the predicates:

def Plural(num):
  return num > 1

def Singular(num):
  return num == 1





> <b>hello</b>
> {.or}
> <i>bye</i>
> {.end}
>
> {.section jj}
> stuff
> {.end}
>
> {.section bar advancedSetting|true?}
> <b>hello</b>
> {.or}
> <i>bye</i>
> {.end}
>
> the second section having bar not foo....
>
> I'll move the discussion over to the Google Group from here on out. Sorry  
> to clutter
> up the issues list...
>
> --
> You received this message because you are listed in the owner
> or CC fields of this issue, or because you starred this issue.
> You may adjust your issue notification preferences 
> at:http://code.google.com/hosting/settings
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "JSON 
Template" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/json-template?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to