A spec-complete implementation of the Mustache template language for Arduino. The best way to generate complex text content such as HTML, with full support for all Mustache features and 100% test coverage. A sane alternative to building up complex strings via concatenation and custom code. Very useful for embedded web servers!
Complete support for all elements of the Mustache core specification version 1.4.1, with 100% of tests passing. Supported features:
- Interpolation
- Sections
- Iteration
- Partials
- Comments
- Custom delimiters
See the mustache documentation for more details on these features.
ArduinoJson::JsonDocument data;
data[F("subject")] = F("world");
const String output = ministache::render(F("Hello, {{subject}}!"), data);
Serial.println(output); // Hello, world!
See basic.ino for a sketch demonstrating basic Ministache usage.
Partials are a powerful Mustache feature, allowing you to define a chunk of template code and use it in a loop. See partials.ino for a sketch demonstrating how to use partials with Ministache.
I hope this is useful to you! If it is, then maybe you'd like to buy me a coffee? 😊