const classmustache::Mustache


Mustache can be used for HTML, config files, source code - anything. It works by expanding tags in a template using values provided in a hash or object.

We call it "logic-less" because there are no if statements, else clauses, or for loops. Instead there are only tags. Some tags are replaced with a value, some nothing, and others a series of values.

A typical Mustache template:

Hello {{name}}
You have just won ${{value}}!
Well, ${{taxed_value}}, after taxes.

Given the following hash:

[ "name": "Chris",
  "value": 10000,
  "taxed_value": |->Decimal| { return 10000.0 - (10000.0 * 0.4) },
  "in_ca": true

Will produce the following:

Hello Chris
You have just won $10000!
Well, $6000.0, after taxes.

This doc is based on original mustache man page:


Void _dumpTree()


new forParser(MustacheParser parser)


new make(InStream templateStream, Str otag := "{{", Str ctag := "}}")


Str render(Obj? context := null, Str:Mustache partials := [:], Obj?[] callStack := [,], Str indentStr := "")


const static Str specVersion := "1.1.2"