CloudyKit / jet

Jet template engine
Apache License 2.0
1.26k stars 106 forks source link

Add simple for loop for repeating a block #163

Closed pipe01 closed 4 years ago

pipe01 commented 4 years ago

For example:

{{repeat i := 1 to 6}}
   ...
{{end}}
sauerbraten commented 4 years ago

Jet v4 has a built-in ints-Ranger and new one-var range assignment syntax, so you can write range i := ints(0,6) now to get i == 0 to i == 5.

I think that's enough and there's no need to add new syntax for this use case.

pipe01 commented 4 years ago

Yeah that covers it, now I just have to wait for Iris to update to v4. Thank you!