A handlebars like template library for lua.
Idempotent
stage: run
format string
{{format "Hello there %q!" "World"}}
stage: run
Log to stdout
<a>foo</a>{{log "Hello world"}}
<a>bar</a>
Idempotent
stage: run
Lowercase string
{{lower "UPPERCASE IS CRUISE CONTROL FOR COOL"}}
Idempotent
stage: run
Replaces all occurrences of a pattern in a string with a replacement string.
{{gsub "all the space are belong to us" " " "" }}
Block
Idempotent
stage: code_generation
Unless block
{{#unless nothing}}
foobar
{{/unless}}
stage: run
Log to stderr
Block
Idempotent
stage: code_generation
If block
{{#if isFoo}}<a>foo</a>
{{else}}<a>bar</a>
{{/if}}
{{#if isBar}}<div>bar</div>
{{else}}<div>foo</div>
{{/if}}
Idempotent
stage: run
Extract substring
{{sub "mylongstring" 3 -1}}
Idempotent
stage: run
Uppercase string
{{upper "I want to be uppercase"}}
Block
Idempotent
stage: code_generation
Each block
{{#each a}}<a>{{this}}</a>
{{/each}}
{{#each b}}<a>{{this}}</a>
{{else}}<a>No b</a>
{{/each}}
{{#each a}}<a>{{@key}}</a>
<a>{{@index}}</a>
{{else}}<a>No b</a>
{{/each}}
Block
Idempotent
stage: code_generation
With block
{{#with a}}
<a> name: {{name}}</a>
<a> address: {{addr}}</a>
{{/with}}
Block
Idempotent
stage: code_generation
Iterate trough a matches of a pattern see lua patterns
{{#gmatch "one, two, three" "%w+"}}
{{this}}
{{/gmatch}}