Wrapper and helpers around Mustache templates
<dependency>
<groupId>com.zandero</groupId>
<artifactId>templates</artifactId>
<version>1.4</version>
</dependency>
MustacheUtils utils = new MustacheUtils();
Mustache template = utils.load("/templates/hello.html");
Map<String, String> data = new HashMap<>();
data.put("name", "world");
String result = utils.render(template, data);
MustacheUtils utils = new MustacheUtils();
Mustache template = utils.load("/templates/hello.html");
String result = utils.renderJson(template, "{\"name\": \"world\"}");
MustacheUtils utils = new MustacheUtils();
Mustache template = utils.load("/templates/hello.html");
String result = utils.renderStrings(template, "name", "world");
Class wrapping MustacheUtils to simplify usage.
Map<String, Object> data = new HashMap<>();
data.put("name", "world");
String result = Templates.render("/templates/hello.html", data);
String result = Templates.renderJson("/templates/hello.html", "{\"name\": \"world\"}");
Using a base template to wrap around other templates.