Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
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.
Classes
GRMustache1-ios.xcodeproj
GRMustache1-macosx.xcodeproj
Guides
Libs/groue
Scripts
Tests
include
lib
.gitignore
.gitmodules
Makefile
README.md
RELEASE_NOTES.md
TODO.txt

README.md

GRMustache

GRMustache is an Objective-C implementation of the Mustache logic-less template engine.

The Mustache syntax: http://mustache.github.com/mustache.5.html (not wrong, but somewhat outdated).

A list of Mustache implementations in other languages: http://mustache.github.com/

Breaking news on Twitter: http://twitter.com/GRMustache

What you get

MacOS 10.6+, iPhoneOS 3.0, iOS 4.0+ support

An ARC-compatible static library, that will run on your computers, devices, simulators.

Compatibility with other Mustache implementations: Mustache specification v1.1.2 conformance.

Compatibility with previous GRMustache versions: update GRMustache, enjoy performance improvements and bugfixes, and don't change a line of your code. You may get harmless deprecation warnings, though. Check the release notes.

Expressiveness: GRMustache lets you break out of Mustache limits, in conscience, when you need.

Documentation: GRMustache online documentation is provided as guides and sample code:

Usage

GRMustache rendering is the combination of a template string and of an object that will provide the data.

You can render templates on the fly:

#import "GRMustache.h"

NSString *templateString = @"Hello {{name}}!";
Person *arthur = [Person personWithName:@"Arthur"];

// Renders "Hello Arthur!"
NSString *rendering = [GRMustacheTemplate renderObject:arthur fromString:templateString error:NULL];

You can also parse a template once, and render it many times.

GRMustacheTemplate *template = [GRMustacheTemplate templateFromString:templateString error:NULL];
rendering = [template renderObject:arthur];
rendering = [template renderObject:...];

Speaking of templates, GRMustache eats many kinds of them: files and bundle resources as well as raw strings. For more information, check Guides/templates.md.

Regarding the data objects, GRMustache fetches values with the standard Key-Value Coding valueForKey: method. Check Guides/runtime.md.

Forking

Please fork. You'll learn useful information in Guides/forking.md.

License

Released under the MIT License

Copyright (c) 2012 Gwendal Roué

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Something went wrong with that request. Please try again.