On Fri, Oct 2, 2009 at 11:31 AM, Steven Roussey <[email protected]> wrote:
>
> Is there a use case for this? I think it ought to start from 1.
>
> {.repeated section foo}
>   {$index} -- {item}<br>
> {.end}
>
> I doubt people want it to result in:
>
>  0 -- John
>  1 -- Steve
>  2 -- Cathy
>
> Where this makes more sense:
>
>  1 -- John
>  2 -- Steve
>  3 -- Cathy

Yeah, I thought about this.  It's not a big deal because they're
supposed to changed by formatters.  We can include a 1-based
formatter:

{$index|1-based}
{$index|AtoZ}

If everyone thinks it should be 1, then I'm OK with it, as we can
provide 0-based to make it start at 0.  For source code generation you
might want 0-based indices.

> Also, should be have a {.header} and {.footer} for repeated sections?
> I think the this looks better than the option below it:

This should be covered by the idiom:

{.section foo}
  header
  {.repeated section @}
    {$index} {...@}
  {.end}
  footer
{.end}

Andy

--~--~---------~--~----~------------~-------~--~----~
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