Musty is an implementation of the Mustache templating language in Janet.
Mustache templates are strings with special values that are expanded when rendered. Give Musty your template string, a context dictionary and an optional directory path for partials. You get back the expanded string. Too easy.
Musty passes Mustache's specs for variables, sections, inverted sections, comments, partials and custom delimiters. It does not support lambdas, dynamic names or inheritance.
Add the dependency to your info.jdn file:
:dependencies ["https://github.com/pyrmont/musty"]Musty can be used like this:
(import musty)
(musty/render "Hello {{world}}!" {:world "everybody"} :dir ".")
# => "Hello everybody!"Check out the API document for more information.
Found a bug? I'd love to know about it. The best way is to report your bug in the Issues section on GitHub.
Musty is licensed under the MIT Licence. See LICENSE for more details.