Template helper compile

bauplan.helpers

Compile a string as a template

Given a context where {bar: "baz", wham: {bar: "whizz"}}

{{compile "foo {{bar}}"}} -> "foo bar"

{{{compile "foo {{bar}}" context="wham"}}} -> "foo whizz"

{{{compile "foo {{bar}}" context="nosuch"}}} -> "foo "
Source:
Parameters:
Name Type Attributes Description
0 string

String to compile

context string <optional>

Pass a different context - (the value must be a property key of the current context)