Skip to content

Ribboncurls is a Rust template rendering engine.

License

Notifications You must be signed in to change notification settings

tinted-theming/ribboncurls

Repository files navigation

Ribboncurls

Ribboncurls logo

Matrix Chat Crates.io Tests

Ribboncurls is a Mustache template rendering engine written in Rust.

There is both a Rust Ribboncurls library and Ribboncurls CLI tool, depending on your needs. You can read more about those specific projects in their respective README.md files.

Note: Ribboncurls library public API is subject to change, so use with caution.

Features

Ribboncurls supports all the required Mustache features as per Mustache spec and runs against the Mustache v1.4.2 spec tests.

  • Comments: 12345{{! Comment Block! }}67890
  • Delimiters: Change delimiters from {{ }} to your own custom delimiters
    • {{=<% %>=}}(<%text%>)
  • Interpolation
    • {{text}} - Renders escaped variable text
    • {{&text}}, {{{text}}} - Renders variable text without escaping
    • {{a.b.c.d}} - Renders HashMap properties
    • and more
  • Sections
    • {{#text}}Renders when text exists{{/text}} - Renders section when text is truthy
    • {{#animals_array}}({{.}}){{/list}} - Implicit iterator
  • Inverted: Functionally serves as inverted sections
    • {{^text}}Renders when text does not exist{{/text}}
  • Partials: Used to expand an external template into the current template
    • {{>partial_property}}

Code of Conduct

This project and everyone participating in it is governed by the Tinted Theming Code of Conduct.

License

Ribboncurls is licensed under the MPL-2.0 license.

Third-Party Licenses

This project includes third-party code licensed under the MPL-2.0 license. See the THIRD_PARTY_LICENSES file for details.