From 16015041e44d9720ad1baeaa2a0604367ff97a77 Mon Sep 17 00:00:00 2001 From: Brian Sharon Date: Mon, 8 Jul 2024 14:36:48 -0600 Subject: [PATCH 1/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ed9df0f..958c431 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ # Ministache -A spec-complete implementation of the [Mustache](https://mustache.github.io/) templating language for Arduino. A sane alternative to building up complex strings via concatenation and custom code. Very useful for embedded web servers! +A spec-complete implementation of the [Mustache](https://mustache.github.io/) 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! ## Features From 8ff58578694e47add209e29de441866d5d806890 Mon Sep 17 00:00:00 2001 From: Brian Sharon Date: Mon, 8 Jul 2024 14:54:58 -0600 Subject: [PATCH 2/3] Clean up partials example --- examples/partials/partials.ino | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/examples/partials/partials.ino b/examples/partials/partials.ino index 7a3c612..f5d779d 100644 --- a/examples/partials/partials.ino +++ b/examples/partials/partials.ino @@ -29,18 +29,23 @@ void setup() { JsonDocument data; deserializeJson(data, json); - // Create a template string that renders the data for a single person. This is a *partial*. - String personString = "Name: {{name}}\tRole: {{role}}\n"; + // Create a template that renders the data for a single person. This is a *partial*. + auto personTemplate = "Name: {{name}}\tRole: {{role}}\n"; - // Create a template string that renders the data for all people. This is the main template. - // Note that it loops over a field called "people" and includes the partial "person" for each of + // Create a template that renders the data for all people. This is the main template. + // Note that it loops over a data field called "people", and includes the partial "person" for each of // them. - String reportString = "People report:\n{{#people}}{{> person}}{{/people}}"; + auto reportTemplate = R"""( + People report: + {{#people}} + {{> person}} + {{/people}} + )"""; // Render the template with the data. The third argument is the partials list. This // defines how to map a partial reference like "person" to a particular template // ("personString"). - String output = ministache::render(reportString, data, {{"person", personString}}); + auto output = ministache::render(reportTemplate, data, {{"person", personTemplate}}); // Print the result Serial.println(output); From 58a7e0bf001ed2f1758a5e48443048767dd0849b Mon Sep 17 00:00:00 2001 From: Brian Sharon Date: Mon, 8 Jul 2024 15:06:07 -0600 Subject: [PATCH 3/3] Try to improve arduino library search results, bump version --- examples/partials/partials.ino | 3 ++- library.json | 4 ++-- library.properties | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/partials/partials.ino b/examples/partials/partials.ino index f5d779d..53a5e87 100644 --- a/examples/partials/partials.ino +++ b/examples/partials/partials.ino @@ -45,7 +45,8 @@ void setup() { // Render the template with the data. The third argument is the partials list. This // defines how to map a partial reference like "person" to a particular template // ("personString"). - auto output = ministache::render(reportTemplate, data, {{"person", personTemplate}}); + ministache::PartialList partials = {{"person", personTemplate}}; + auto output = ministache::render(reportTemplate, data, partials); // Print the result Serial.println(output); diff --git a/library.json b/library.json index b9d2912..42c9cda 100644 --- a/library.json +++ b/library.json @@ -1,7 +1,7 @@ { "name": "Ministache", - "version": "1.0.0", - "description": "Ministache is a small, fast and spec-complete implementation of the Mustache templating language for Arduino. All core Mustache tags are supported: interpolation, partials, sections, inverted sections, custom delimiters, and comments.", + "version": "1.0.1", + "description": "A small, fast and spec-complete implementation of the Mustache template language for Arduino, supporting interpolation, partials, sections, inverted sections, custom delimiters, and comments.", "keywords": ["mustache", "moustache", "text", "text processor", "template", "logic-less", "html"], "repository": { "type": "git", diff --git a/library.properties b/library.properties index a4852a3..5f4825f 100644 --- a/library.properties +++ b/library.properties @@ -1,9 +1,9 @@ name=Ministache -version=1.0.0 +version=1.0.1 author=Brian Sharon maintainer=Brian Sharon -sentence=Complete implementation of a Mustache template processor for Arduino -paragraph=Ministache is a small, fast and spec-complete implementation of the Mustache templating language for Arduino. All core Mustache tags are supported: interpolation, partials, sections, inverted sections, custom delimiters, and comments. +sentence=Mustache template engine for Arduino and ESP32 - render HTML templates dynamically +paragraph=A small, fast and spec-complete implementation of the Mustache template language for Arduino, supporting interpolation, partials, sections, inverted sections, custom delimiters, and comments. category=Data Processing url=https://github.com/floatplane/ministache architectures=*