Skip to content

mk270/erlang-mustache

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mustache Templating

Specifications

This library implements the API of mustache from:

http://mustache.github.com/mustache.5.html

Render Function

The render accepts either a Unicode character list or a UTF-8 binary as the template.

The Context is a dictionary:

  • keys are either atom() or string()
  • the data items are:
    • Unicode character list (Variable, Partial)
    • UTF-8 binary (Variable, Partial)
    • Integer (Variable)
    • Float (Variable)
    • Function/1 argument is current Context (Variable, Partial)
    • Function/2 areguments Template and Render function (Section)
    • Dictionary in single element tuple (Section)
    • List of dictionaries in single element tuple (Section)
    • Property List [{atom()|string(), any()}] (Section)

Notes

Erlang dictionaries are system specific and cannot reliably be detected, at present dictionaries are wrapped in a single element tuple ({dict()}). A dictionary list is of type: [{dict()}].

The name of this is module hxw_mustache to avoid namespace conflics with rebar which also contains its own mustache.erl.

About

Implementation of mustache templating in Erlang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Erlang 92.0%
  • Makefile 7.8%
  • HTML 0.2%