Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 798 Bytes

string_mustache.markdown

File metadata and controls

26 lines (17 loc) · 798 Bytes
layout title published
default
string_mustache
true

[%CFEngine_function_prototype(template_string, optional_data_container)%]

Description: Formats a Mustache string template into a string, using either the system datastate() or an explicitly provided data container.

The usual Mustache facilities like conditional evaluation and loops are available, see the example below.

[%CFEngine_function_attributes(template_string, optional_data_container)%]

Example: {%raw%} [%CFEngine_include_snippet(string_mustache.cf, #+begin_src cfengine3, .*end_src)%] {%endraw%}

Output:

[%CFEngine_include_snippet(string_mustache.cf, #+begin_src\s+example_output\s*, .*end_src)%]

History: Introduced in CFEngine 3.7

See also: datastate(), readjson(), parsejson(), data.