Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Flexible and production-ready Mustache templates for MacOS Cocoa and iOS
Objective-C HTML C Other

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
Articles
Guides
Reference/html
include
lib
src
.gitignore
.gitmodules
AppledocSettings.plist
GRMustache.podspec
LICENSE
Makefile
README.md
RELEASE_NOTES.md
TODO.md

README.md

GRMustache

GRMustache is a flexible and production-ready implementation of Mustache templates for MacOS Cocoa and iOS.

March 22, 2014: GRMustache 7.0.1 is out. Release notes

System requirements: GRMustache targets iOS down to version 4.3, MacOS down to 10.6 Snow Leopard (without garbage collection), and only depends on the Foundation framework.

Get release announcements and usage tips: follow @GRMustache on Twitter.

How To

1. Setup your Xcode project

You have three options, from the simplest to the hairiest:

2. Start rendering templates

#import "GRMustache.h"

One-liners:

// Renders "Hello Arthur!"
NSString *rendering = [GRMustacheTemplate renderObject:@{ @"name": @"Arthur" } fromString:@"Hello {{name}}!" error:NULL];
// Renders the `Profile.mustache` resource of the main bundle
NSString *rendering = [GRMustacheTemplate renderObject:user fromResource:@"Profile" bundle:nil error:NULL];

Reuse templates in order to avoid parsing the same template several times:

GRMustacheTemplate *template = [GRMustacheTemplate templateFromResource:@"Profile" bundle:nil error:nil];
rendering = [template renderObject:arthur error:NULL];
rendering = [template renderObject:barbara error:NULL];
rendering = ...

GRMustachio by Jonathan Mitchell is "A super simple, interactive GRMustache based application". It can help you design and test your templates.

Documentation

If you don't know Mustache, start here: http://mustache.github.io/mustache.5.html

License

Released under the MIT License.

Something went wrong with that request. Please try again.