Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 121 lines (67 sloc) 6.375 kb
a81f56a @groue Restore README title
authored
1 GRMustache
2 ==========
3
4 GRMustache is a production-ready implementation of [Mustache](http://mustache.github.com/) templates for MacOS Cocoa and iOS.
5
7929a5b @groue Release announcement in README.md
authored
6 **July 1st, 2012: GRMustache 4.1.1 is out.** [Release notes](GRMustache/blob/master/RELEASE_NOTES.md)
f01775d @groue README
authored
7
4f1625f @groue guides
authored
8 Breaking news on Twitter: http://twitter.com/GRMustache
070c126 @groue dot variable extension
authored
9
66a61ab @groue README
authored
10 How To
11 ------
f52da9d @groue README+RELEASE_NOTES for GRMustacheNumberFormatterHelper and GRMustac…
authored
12
559f600 @groue CocoaPods support
authored
13 ### 1. Download and add to your Xcode project
acb8902 @groue wording
authored
14
cf09386 @groue More straightforward README
authored
15 $ git clone https://github.com/groue/GRMustache.git
f5fb58f @groue wording
authored
16
651221e @groue Can't get used to "OS X" wording - restore "MacOS"
authored
17 - For MacOS development, add `include/GRMustache.h` and `lib/libGRMustache4-MacOS.a` to your project.
498f196 @groue Attempt to clarify the targeted system versions
authored
18 - For iOS development, add `include/GRMustache.h` and `lib/libGRMustache4-iOS.a` to your project.
19
651221e @groue Can't get used to "OS X" wording - restore "MacOS"
authored
20 GRMustache can target MacOS down to 10.6 Snow Leopard, and iOS down to version 3. However, APIs based on Objective-C blocks and NSURL are only available from iOS4.
b5c4640 @groue Expressiveness
authored
21
ef1f7e4 @groue Warn CocoaPods users against private headers
authored
22 Alternatively, you may use [CocoaPods](https://github.com/CocoaPods/CocoaPods): append `dependency 'GRMustache'` to your Podfile. In its current version, CocoaPods exposes private headers that you should not rely on, because future versions of GRMustache may change them, without notice, in an incompatible fashion. Make sure you only import `GRMustache.h`.
559f600 @groue CocoaPods support
authored
23
24 ### 2. Import "GRMustache.h" and start rendering templates
1f63119 @groue wording
authored
25
c3116bd @groue GitHub Flavored Markdown
authored
26 ```objc
27 #import "GRMustache.h"
28
29 // Renders "Hello Arthur!"
b15c302 @groue More straightforward README
authored
30 NSString *rendering = [GRMustacheTemplate renderObject:[Person personWithName:@"Arthur"]
31 fromString:@"Hello {{name}}!"
32 error:NULL];
f52da9d @groue README+RELEASE_NOTES for GRMustacheNumberFormatterHelper and GRMustac…
authored
33
66a61ab @groue README
authored
34 // Renders from a resource
35 NSString *rendering = [GRMustacheTemplate renderObject:[Person personWithName:@"Arthur"]
36 fromResource:@"Profile" // loads `Profile.mustache`
37 bundle:nil
38 error:NULL];
39 ```
f52da9d @groue README+RELEASE_NOTES for GRMustacheNumberFormatterHelper and GRMustac…
authored
40
559f600 @groue CocoaPods support
authored
41
634ad41 @groue wording
authored
42 Documentation
43 -------------
44
e8f9e1e @groue Reorganize documentation
authored
45 ### Mustache syntax
46
47 - http://mustache.github.com/mustache.5.html
48
49 ### Guides
cf09386 @groue More straightforward README
authored
50
a3f63cb @groue Link to sample code repository https://github.com/groue/GRMustacheSam…
authored
51 - [Guides/templates.md](GRMustache/blob/master/Guides/templates.md): how to load, parse, and render templates from various sources.
52 - [Guides/runtime.md](GRMustache/blob/master/Guides/runtime.md): how to provide data to templates.
53 - [Guides/delegate.md](GRMustache/blob/master/Guides/delegate.md): how to hook into template rendering.
e8f9e1e @groue Reorganize documentation
authored
54
55 ### Sample code
56
7738fdd @groue Fix internal guide links
authored
57 - [Guides/sample_code](GRMustache/tree/master/Guides/sample_code): because some tasks are easier to do with some guidelines.
9228835 @groue Common use cases right in the README
authored
58
e8f9e1e @groue Reorganize documentation
authored
59 ### Reference
60
a3f63cb @groue Link to sample code repository https://github.com/groue/GRMustacheSam…
authored
61 - [Reference](http://groue.github.com/GRMustache/Reference/): the GRMustache reference, automatically generated from inline documentation, for fun and profit, by [appledoc](http://gentlebytes.com/appledoc/).
e8f9e1e @groue Reorganize documentation
authored
62
9228835 @groue Common use cases right in the README
authored
63
64 FAQ
65 ---
66
caedcda @groue Wording consistency
authored
67 - **Q: How do I render array indexes?**
9228835 @groue Common use cases right in the README
authored
68
da9cdeb @groue indexes.md guide
authored
69 A: Check [Guides/sample_code/indexes.md](GRMustache/blob/master/Guides/sample_code/indexes.md)
9228835 @groue Common use cases right in the README
authored
70
b483251 @groue Filters FAQ
authored
71 - **Q: How do I implement filters, format numbers, dates, etc?**
72
53c25e2 @groue Revert "Filters FAQ"
authored
73 A: Check documentation of [Mustache lambda sections](GRMustache/blob/master/Guides/runtime/helpers.md) first. If it would not help, maybe you'll get some inspiration from the [number formatting sample code](GRMustache/blob/master/Guides/sample_code/number_formatting.md). If you are still stuck after those, go and look for a [closed issue](GRMustache/issues?state=closed) that covers your need. Finally, open a new issue :-)
b483251 @groue Filters FAQ
authored
74
71d71cc @groue typo
authored
75 - **Q: Does GRMustache provide any layout facility?**
1aedee0 @groue Link to layout sample project from the README
authored
76
77 A: No. But there is a [sample Xcode project](GRMustache/tree/master/Guides/sample_code/layout) that demonstrates how to do that.
78
9228835 @groue Common use cases right in the README
authored
79 - **Q: How do I render default values for missing keys?**
80
81 A: This can be done by providing your template a delegate: check [Guides/delegate.md](GRMustache/blob/master/Guides/delegate.md).
82
95ee6b0 @groue Typo
authored
83 - **Q: I have a bunch of templates and partials that live in memory / a database / the cloud / wherever.**
c1bd462 @groue README
authored
84
1d73c2b @groue GRMustacheTemplateRepository guides
authored
85 A: Check [Guides/template_repositories.md](GRMustache/blob/master/Guides/template_repositories.md).
c1bd462 @groue README
authored
86
4973f8c @groue README
authored
87 - **Q: What is this NSUndefinedKeyException stuff?**
88
89 A: When GRMustache has to try several objects until it finds the one that provides a `{{key}}`, several NSUndefinedKeyException are raised and caught. Let us double guess you: it's likely that you wish Xcode would stop breaking on those exceptions. This use case is covered in [Guides/runtime/context_stack.md](GRMustache/blob/master/Guides/runtime/context_stack.md).
9228835 @groue Common use cases right in the README
authored
90
9f3dcaf @groue Answer to FAQ: "Why does GRMustache need JRSwizzle?"
authored
91 - **Q: Why does GRMustache need JRSwizzle?**
92
93 A: GRMustache will [swizzle](http://www.mikeash.com/pyblog/friday-qa-2010-01-29-method-replacement-for-fun-and-profit.html) the implementation of `valueForUndefinedKey:` in the NSObject and NSManagedObject classes when you invoke `[GRMustache preventNSUndefinedKeyExceptionAttack]`. This use case is covered in [Guides/runtime/context_stack.md](GRMustache/blob/master/Guides/runtime/context_stack.md). The dreadful swizzling happens in [src/classes/GRMustacheNSUndefinedKeyExceptionGuard.m](GRMustache/blob/master/src/classes/GRMustacheNSUndefinedKeyExceptionGuard.m).
94
9228835 @groue Common use cases right in the README
authored
95
96 Contribution wish-list
97 ----------------------
98
99 I wish somebody would review my non-native English, and clean up the guides, if you ask.
f52da9d @groue README+RELEASE_NOTES for GRMustacheNumberFormatterHelper and GRMustac…
authored
100
f5fb58f @groue wording
authored
101
c0e699e @groue wip
authored
102 Forking
103 -------
104
d8957ab @groue renamed guides to Guides
authored
105 Please fork. You'll learn useful information in [Guides/forking.md](GRMustache/blob/master/Guides/forking.md).
c0e699e @groue wip
authored
106
f5fb58f @groue wording
authored
107
e4bd74e @groue License
authored
108 License
109 -------
110
111 Released under the [MIT License](http://en.wikipedia.org/wiki/MIT_License)
112
4f1625f @groue guides
authored
113 Copyright (c) 2012 Gwendal Roué
e4bd74e @groue License
authored
114
115 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:
116
117 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
118
119 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.
120
Something went wrong with that request. Please try again.