All Projects → rgrinberg → ocaml-mustache

rgrinberg / ocaml-mustache

Licence: MIT license
mustache.js logic-less templates in OCaml

Programming Languages

ocaml
1615 projects
perl
6916 projects
Mustache
554 projects

Projects that are alternatives of or similar to ocaml-mustache

VueXcode
Syntax highlighting for .Vue components and .mustache templates in Xcode
Stars: ✭ 25 (-66.22%)
Mutual labels:  mustache, mustache-templates
docxmustache
laravel 8.x docx template manipulation class, based on mustache templating language
Stars: ✭ 34 (-54.05%)
Mutual labels:  mustache, mustache-templates
Apacheexpress
Reliable Server Side Swift ✭ Make Apache great again!
Stars: ✭ 170 (+129.73%)
Mutual labels:  mustache
Helm Charts
Jenkins community Helm charts
Stars: ✭ 154 (+108.11%)
Mutual labels:  mustache
Charts
Stars: ✭ 206 (+178.38%)
Mutual labels:  mustache
Inlets Pro
Secure TCP and HTTP tunnels that work anywhere
Stars: ✭ 179 (+141.89%)
Mutual labels:  mustache
Chevron
A Python implementation of mustache
Stars: ✭ 223 (+201.35%)
Mutual labels:  mustache
Hydro Serving
MLOps Platform
Stars: ✭ 213 (+187.84%)
Mutual labels:  mustache
Statik
Multi-purpose static web site generator aimed at developers.
Stars: ✭ 249 (+236.49%)
Mutual labels:  mustache
Gluebert
gluebert.js is a tiny helper lazy loading DOM Elements, StyleSheets and JavaScript files using dynamic import and code splitting
Stars: ✭ 194 (+162.16%)
Mutual labels:  mustache
Milk
Milk is Mustache in CoffeeScript -- great with your browser or NodeJS!
Stars: ✭ 192 (+159.46%)
Mutual labels:  mustache
Pihole Kubernetes
PiHole on kubernetes
Stars: ✭ 180 (+143.24%)
Mutual labels:  mustache
Stubble
Trimmed down {{mustache}} templates in .NET
Stars: ✭ 247 (+233.78%)
Mutual labels:  mustache
Ramhorns
Fast Mustache template engine implementation in pure Rust.
Stars: ✭ 172 (+132.43%)
Mutual labels:  mustache
dssg
A static site generator with a different approach
Stars: ✭ 15 (-79.73%)
Mutual labels:  mustache
Spring Boot Email Tools
A set of services and tools for sending emails in a Spring Boot 1.5.x application using a Template Engine
Stars: ✭ 164 (+121.62%)
Mutual labels:  mustache
Micromustache
Ⓜ An extremely fast and small sub-implementation of the {{mustache}} template engine for JavaScript
Stars: ✭ 186 (+151.35%)
Mutual labels:  mustache
hesperides
Configuration management tool providing universal text file templating and properties editing through a REST API or a webapp (backend part)
Stars: ✭ 35 (-52.7%)
Mutual labels:  mustache
php-mustache
Mustache PHP Extension
Stars: ✭ 55 (-25.68%)
Mutual labels:  mustache
abap mustache
Mustache template engine for ABAP
Stars: ✭ 14 (-81.08%)
Mutual labels:  mustache

ocaml-mustache

mustache.js logic-less templates in OCaml

Example usage

let tmpl =
  try
    Mustache.of_string "Hello {{name}}\n\
                        Mustache is:\n\
                        {{#qualities}}\
                        * {{name}}\n\
                        {{/qualities}}"
  with Mustache.Parse_error err ->
    Format.eprintf "%a@."
      Mustache.pp_template_parse_error err;
    exit 3

let json =
  `O [ "name", `String "OCaml"
     ; "qualities", `A [ `O ["name", `String "awesome"]
                       ; `O ["name", `String "simple"]
                       ; `O ["name", `String "fun"]
                       ]
     ]

let rendered =
  try Mustache.render tmpl json
  with Mustache.Render_error err ->
    Format.eprintf "%a@."
      Mustache.pp_render_error err;
    exit 2

Supported template language

ocaml-mustache accepts the whole Mustache template language, except:

  • it does not support setting delimiter tags to something else than '{{' and '}}'.
  • it does not support lambdas inside the provided data

It is automatically tested against the latest mustache specification testsuite.

ocaml-mustache also supports template inheritance / partials with parameters, tested against the semi-official specification.

Todo/Wish List

  • Support for ropes

http://mustache.github.io/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].