Outputs a choice matching the variable passed in
{{#choose x}}
{{#choice "a"}} A {{/choice}}
{{#choice "b"}} B {{/choice}}
{{/choose}
{{#choose x}}
This gets output whaver the value of x
{{#choice "a"}} A {{/choice}}
{{#choice "b"}} B {{/choice}}
{{/choose}
{{#choose x}}
{{#choice "a"}} A {{/choice}}
{{#choice "b c d e"}} BCDE {{/choice}}
{{/choose}
{{#choose x}}
{{#choice "a b c"}} ABC {{/choice}}
{{#choice "b d"}} BD {{/choice}}
{{#choice "e"}} E {{/choice}}
{{/choose}
Numbers are processed as inflection keywords
{{#choose x}}
{{x}}
{{#choice "zero other"}} ducks {{/choice}}
{{#choice "one"}} duck {{/choice}}
{{/choose}
Booleans are processed as boolean keywords
{{#choose x}}
{{#choice "true"}} TRUE {{/choice}}
{{#choice "false"}} FALSE {{/choice}}
{{/choose}}
Non-booleans can be forced to be processed as booleans
{{#choose x type="boolean"}}
{{#choice "true"}} TRUE {{/choice}}
{{#choice "false"}} FALSE {{/choice}}
{{/choose}}
Alternative choosing functions can be passed in - the following three examples are functionally equivalent
{{#choose fn x=x}}
{{#choice "a"}} A {{/choice}}
{{#choice "b"}} B {{/choice}}
{{/choose}}
{{#choose x function=fn}}
{{#choice "a"}} A {{/choice}}
{{#choice "b"}} B {{/choice}}
{{/choose}}
{{#choose x=x function=fn}}
{{#choice "a"}} A {{/choice}}
{{#choice "b"}} B {{/choice}}
{{/choose}}
Keyword choices can be provided as attributes rather than as nested choice helpers
{{choose x foo="Option Foo" bar="Option Bar"}}
Captured content provides fallback option if no attributes matched
{{#choose x foo="Option Foo" bar="Option Bar"}} Fallback option {{/choose}}
- Source: