Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 101 lines (57 sloc) 4.92 kB
f01775d @groue README
authored
1 GRMustache
2 ==========
3
c1c98e2 @groue less verbose README
authored
4 GRMustache is an Objective-C implementation of the [Mustache](http://mustache.github.com/) logic-less template language.
f01775d @groue README
authored
5
c1c98e2 @groue less verbose README
authored
6 The Mustache syntax: http://mustache.github.com/mustache.5.html.
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
f52da9d @groue README+RELEASE_NOTES for GRMustacheNumberFormatterHelper and GRMustac…
authored
10
66a61ab @groue README
authored
11 How To
12 ------
f52da9d @groue README+RELEASE_NOTES for GRMustacheNumberFormatterHelper and GRMustac…
authored
13
559f600 @groue CocoaPods support
authored
14 ### 1. Download and add to your Xcode project
acb8902 @groue wording
authored
15
cf09386 @groue More straightforward README
authored
16 $ git clone https://github.com/groue/GRMustache.git
f5fb58f @groue wording
authored
17
3c876c0 @groue v3.0.0
authored
18 - For MacOS 10.6+ development, add `include/GRMustache.h` and `lib/libGRMustache3-MacOS.a` to your project.
19 - For iOS3+ development, add `include/GRMustache.h` and `lib/libGRMustache3-iOS.a` to your project.
b5c4640 @groue Expressiveness
authored
20
ef1f7e4 @groue Warn CocoaPods users against private headers
authored
21 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
22
23 ### 2. Import "GRMustache.h" and start rendering templates
1f63119 @groue wording
authored
24
c3116bd @groue GitHub Flavored Markdown
authored
25 ```objc
26 #import "GRMustache.h"
27
28 // Renders "Hello Arthur!"
b15c302 @groue More straightforward README
authored
29 NSString *rendering = [GRMustacheTemplate renderObject:[Person personWithName:@"Arthur"]
30 fromString:@"Hello {{name}}!"
31 error:NULL];
f52da9d @groue README+RELEASE_NOTES for GRMustacheNumberFormatterHelper and GRMustac…
authored
32
66a61ab @groue README
authored
33 // Renders from a resource
34 NSString *rendering = [GRMustacheTemplate renderObject:[Person personWithName:@"Arthur"]
35 fromResource:@"Profile" // loads `Profile.mustache`
36 bundle:nil
37 error:NULL];
38 ```
f52da9d @groue README+RELEASE_NOTES for GRMustacheNumberFormatterHelper and GRMustac…
authored
39
559f600 @groue CocoaPods support
authored
40
634ad41 @groue wording
authored
41 Documentation
42 -------------
43
cf09386 @groue More straightforward README
authored
44 GRMustache online documentation is provided as guides and sample code:
45
46 - [Guides/templates.md](GRMustache/blob/master/Guides/templates.md): how to parse and render templates
47 - [Guides/runtime.md](GRMustache/blob/master/Guides/runtime.md): how to provide data to templates
48 - [Guides/delegate.md](GRMustache/blob/master/Guides/delegate.md): how to hook into template rendering
49 - [Guides/sample_code.md](GRMustache/blob/master/Guides/sample_code.md): because some tasks are easier to do with some guidelines.
9228835 @groue Common use cases right in the README
authored
50
51
52 FAQ
53 ---
54
55 - **Q: How do I render array indices?**
56
8f31d18 @groue README
authored
57 A: Check [Guides/sample_code/counters.md](GRMustache/blob/master/Guides/sample_code/counters.md).
9228835 @groue Common use cases right in the README
authored
58
59 - **Q: How do I render default values for missing keys?**
60
61 A: This can be done by providing your template a delegate: check [Guides/delegate.md](GRMustache/blob/master/Guides/delegate.md).
62
4973f8c @groue README
authored
63 - **Q: I have a bunch of template partials that live in memory, not in the file system. How do I include them?**
c1bd462 @groue README
authored
64
1d73c2b @groue GRMustacheTemplateRepository guides
authored
65 A: Check [Guides/template_repositories.md](GRMustache/blob/master/Guides/template_repositories.md).
c1bd462 @groue README
authored
66
4973f8c @groue README
authored
67 - **Q: I provide false (zero) to a `{{#section}}` but it renders anyway?**
68
69 A: That's because zero (the number) is not considered false by GRMustache. Consider providing an actual boolean, and checking the list of "false" values at [Guides/runtime/booleans.md](GRMustache/blob/master/Guides/runtime/booleans.md).
9228835 @groue Common use cases right in the README
authored
70
4973f8c @groue README
authored
71 - **Q: What is this NSUndefinedKeyException stuff?**
72
73 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
74
75
76 Contribution wish-list
77 ----------------------
78
79 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
80
f5fb58f @groue wording
authored
81
c0e699e @groue wip
authored
82 Forking
83 -------
84
d8957ab @groue renamed guides to Guides
authored
85 Please fork. You'll learn useful information in [Guides/forking.md](GRMustache/blob/master/Guides/forking.md).
c0e699e @groue wip
authored
86
f5fb58f @groue wording
authored
87
e4bd74e @groue License
authored
88 License
89 -------
90
91 Released under the [MIT License](http://en.wikipedia.org/wiki/MIT_License)
92
4f1625f @groue guides
authored
93 Copyright (c) 2012 Gwendal Roué
e4bd74e @groue License
authored
94
95 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:
96
97 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
98
99 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.
100
Something went wrong with that request. Please try again.