functt is a template toolkit that uses a template language which is inspired by the Mustache template language.
- functional interface
- use of c++14 features
- simple to integrate into another codebase because it only consists of a single header
functt::Template view("{{variable}}, {{{variable}}, {{#lambda}}Hello{{/lambda}}");
functt::varmap vars;
functt::funmap funs;
vars["variable"] = "Some Variable";
funs["lambda"] = [](std::string str) {
return str;
};
std::cout << view.render(vars, funs) << std::endl;
// Output: Some Variable, Some Variable, Hello
Variables are by default html escaped: {{variable}}
This variable will not be esacaped: {{{variable}}}
The function called lambda will be called with the string param "Hello" {{#lambda}}Hello{{/lambda}}
functt ist licensed under the MIT license.