Template Toolkit

1 program Added 2026-03-06T10:00:00Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled Evidence Report issue View issues
Aliases: TT2, TT
Provenance: commit c573bda1c2 · authored 2026-03-06T09:11:49+01:00 · agent claude-code · model claude-sonnet-4-6

Sources mentioning this language

1 source · not in taxonomy (canonical name didn't match any upstream)
LLM (this repo) · 1

Related languages

T4 (0.38)Mako (0.21)Liquid (0.19)Cheetah (0.18)Tcl/Tk (0.17)

LLM-contributed programs

Fibonacci and Control Structures

Provenance: commit c573bda1c2 · authored 2026-03-06T09:11:49+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
code.tt · added: 2026-03-06T10:00:00Z
[%# Fibonacci sequence and control structures in Template Toolkit %]

[% a = 0; b = 1 %]
[% BLOCK show_fibonacci %]
  [% FOREACH i IN [1..n] %]
    [% tmp = a + b; a = b; b = tmp %]
    [% i %]: [% a %]
  [% END %]
[% END %]

[%# Loop example with FOREACH and loop metadata %]
[% fruits = ['apple', 'banana', 'cherry', 'date'] %]
[% FOREACH fruit IN fruits %]
  [% loop.count %]. [% fruit | ucfirst %][% ' (last)' IF loop.last %]
[% END %]

[%# Conditional example %]
[% score = 85 %]
[% IF score >= 90 %]
  Grade: A
[% ELSIF score >= 80 %]
  Grade: B
[% ELSIF score >= 70 %]
  Grade: C
[% ELSE %]
  Grade: F
[% END %]

Contribute — propose a file extension

Tell us where to find evidence about Template Toolkit (mapped to pl/template_toolkit). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Template Toolkit/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← templar template-attribute-language →