Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

mustache.js logic-less templates in OCaml

License

NotificationsYou must be signed in to change notification settings

rgrinberg/ocaml-mustache

Repository files navigation

mustache.js logic-less templates in OCaml

Example usage

let tmpl=tryMustache.of_string"Hello {{name}}\n\                        Mustache is:\n\                        {{#qualities}}\                        * {{name}}\n\                        {{/qualities}}"withMustache.Parse_errorerr ->Format.eprintf"%a@."Mustache.pp_template_parse_error err;    exit3let json=`O ["name",`String"OCaml"     ;"qualities",`A [`O ["name",`String"awesome"]                       ;`O ["name",`String"simple"]                       ;`O ["name",`String"fun"]                       ]     ]let rendered=tryMustache.render tmpl jsonwithMustache.Render_errorerr ->Format.eprintf"%a@."Mustache.pp_render_error err;    exit2

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 latestmustache specification testsuite.

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

Todo/Wish List

  • Support for ropes

http://mustache.github.io/

About

mustache.js logic-less templates in OCaml

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors18


[8]ページ先頭

©2009-2025 Movatter.jp