Skip to content

Support the context stack

Compare
Choose a tag to compare
@soranoba soranoba released this 27 Oct 16:34
· 110 commits to master since this release

e.g.

1> Map = #{"a" => #{"one" => 1}, 
1>         "b" => #{"two" => 2},
1>         "c" => #{"three" => 3}}.
#{"a" => #{"one" => 1},"b" => #{"two" => 2},"c" => #{"three" => 3}}
2> Template = <<"{{#a}}"
2>              "{{one}}"
2>              "{{#b}}"
2>              "{{one}}{{two}}{{c.three}}"
2>              "{{/b}}"
2>              "{{/a}}">>.
<<"{{#a}}{{one}}{{#b}}{{one}}{{two}}{{c.three}}{{/b}}{{/a}}">>
3> bbmustache:render(Template, Map).
<<"1123">>

See also:
#17
https://github.com/mustache/spec/blob/v1.1.3/specs/sections.yml#L56-L93