Skip to content

Latest commit

 

History

History
75 lines (57 loc) · 1.73 KB

handlebars-helpers.md

File metadata and controls

75 lines (57 loc) · 1.73 KB

HandlebarsHelpers

Generic helpers that work with any handlebars project

Kind: global namespace


concat(...string, options)

Concatenates two or more strings

Kind: static method of HandlebarsHelpers
Returns: String - - One concatenated string

Param Type Description
...string string two or more strings to concatenate
options Object passed by handlebars
options.hash Object named key/value pairs
options.hash.separator string string to separate each value

Example

{{concat "string1" "string2"}}

Example

{{concat "string1" "string2" separator="-"}}

stringify([string])

JSON.stringify a string or block

Kind: static method of HandlebarsHelpers
Returns: String - - JSON.stringify result of block or string

Param Type Description
[string] string String to use if block is not present

Example

{{stringify "a !string for {json} /end"}}

Example

{{#stringify}}
  mybash.sh -o option1
  continue.sh
{{/stringify}}

Example

{{#stringify noLineBreaks}}
  docker run
  -e VAR1=VAL1
  -e VAR2=VAL2
  my/image
{{/stringify}}