From b1262c8edbe811857efab61254bc9a25c5106fbd Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Wed, 13 Apr 2011 14:50:18 -0700 Subject: [PATCH] Added documentation for {{.}}. --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 4cee32a..4d52003 100644 --- a/README.md +++ b/README.md @@ -159,6 +159,17 @@ lists. }); // result: TomDickHarry +Note that you can also use the special variable `.` to mean the same thing. + + Mustache.compiler().compile("{{.}}").execute("hello"); // returns: hello + Mustache.compiler().compile("{{#names}}{{this}}{/names}}").execute(new Object() { + List names () { return Arrays.asList("Tom", "Dick", "Harry"); } + }); + // result: TomDickHarry + +`.` is apparently supported by other Mustache implementations, though it does +not appear in the official documentation. + ### -first and -last You can use the special variables `-first` and `-last` to perform special processing for list elements. `-first` resolves to `true` when inside a section