Skip to content


Subversion checkout URL

You can clone with
Download ZIP
branch: develop
Fetching contributors…

Cannot retrieve contributors at this time

55 lines (38 sloc) 1.722 kb

chinstrap - mustache C library


chinstrap is a C library which provides mustache template processing. It is intended to be easily usable as a library which can be bound from other languages. It takes a more academic approach to compiling mustache templates and provides such things as a scanner, lexer and parser.

Chinstrap uses 4 stages for successfully rendering mustache templates. The scanner runs through the template and emits single characters to work with. In the next stage the lexer creates meaningful (in the mustache context) tokens of the retrieved characters. These token are then given to the parser, which knows the state machine to render mustache templates and creates a parse tree based on it. The parse tree is then passed to the renderer along with the context to create the rendered template.



int result = chinstrap_render(char const* template, chinstrap context);





If you want to contribute:

  • Fork the project.
  • Make your feature addition or bug fix based on develop.
  • Add tests for it. This is important so I don't break it in a future version unintentionally.
  • Commit, do not mess with version
  • Send me a pull request. Bonus points for topic branches.


  • If you want a more data model agnostic parser checkout crustache
Jump to Line
Something went wrong with that request. Please try again.