Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 110 lines (61 sloc) 5.307 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
4f1625f @groue guides
authored
6 Breaking news on Twitter: http://twitter.com/GRMustache
070c126 @groue dot variable extension
authored
7
f52da9d @groue README+RELEASE_NOTES for GRMustacheNumberFormatterHelper and GRMustac…
authored
8
66a61ab @groue README
authored
9 How To
10 ------
f52da9d @groue README+RELEASE_NOTES for GRMustacheNumberFormatterHelper and GRMustac…
authored
11
559f600 @groue CocoaPods support
authored
12 ### 1. Download and add to your Xcode project
acb8902 @groue wording
authored
13
cf09386 @groue More straightforward README
authored
14 $ git clone https://github.com/groue/GRMustache.git
f5fb58f @groue wording
authored
15
6337526 @groue v4.0.0
authored
16 - For MacOS 10.6+ development, add `include/GRMustache.h` and `lib/libGRMustache4-MacOS.a` to your project.
17 - For iOS3+ development, add `include/GRMustache.h` and `lib/libGRMustache4-iOS.a` to your project.
b5c4640 @groue Expressiveness
authored
18
ef1f7e4 @groue Warn CocoaPods users against private headers
authored
19 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
20
21 ### 2. Import "GRMustache.h" and start rendering templates
1f63119 @groue wording
authored
22
c3116bd @groue GitHub Flavored Markdown
authored
23 ```objc
24 #import "GRMustache.h"
25
26 // Renders "Hello Arthur!"
b15c302 @groue More straightforward README
authored
27 NSString *rendering = [GRMustacheTemplate renderObject:[Person personWithName:@"Arthur"]
28 fromString:@"Hello {{name}}!"
29 error:NULL];
f52da9d @groue README+RELEASE_NOTES for GRMustacheNumberFormatterHelper and GRMustac…
authored
30
66a61ab @groue README
authored
31 // Renders from a resource
32 NSString *rendering = [GRMustacheTemplate renderObject:[Person personWithName:@"Arthur"]
33 fromResource:@"Profile" // loads `Profile.mustache`
34 bundle:nil
35 error:NULL];
36 ```
f52da9d @groue README+RELEASE_NOTES for GRMustacheNumberFormatterHelper and GRMustac…
authored
37
559f600 @groue CocoaPods support
authored
38
634ad41 @groue wording
authored
39 Documentation
40 -------------
41
e8f9e1e @groue Reorganize documentation
authored
42 ### Mustache syntax
43
44 - http://mustache.github.com/mustache.5.html
45
46 ### Guides
cf09386 @groue More straightforward README
authored
47
2569690 @groue Wording
authored
48 - [Guides/templates.md](GRMustache/blob/master/Guides/templates.md): how to load, parse, and render templates from various sources
cf09386 @groue More straightforward README
authored
49 - [Guides/runtime.md](GRMustache/blob/master/Guides/runtime.md): how to provide data to templates
50 - [Guides/delegate.md](GRMustache/blob/master/Guides/delegate.md): how to hook into template rendering
e8f9e1e @groue Reorganize documentation
authored
51
52 ### Sample code
53
cf09386 @groue More straightforward README
authored
54 - [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
55
e8f9e1e @groue Reorganize documentation
authored
56 ### Reference
57
58 - [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/).
59
9228835 @groue Common use cases right in the README
authored
60
61 FAQ
62 ---
63
caedcda @groue Wording consistency
authored
64 - **Q: How do I render array indexes?**
9228835 @groue Common use cases right in the README
authored
65
da9cdeb @groue indexes.md guide
authored
66 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
67
b483251 @groue Filters FAQ
authored
68 - **Q: How do I implement filters, format numbers, dates, etc?**
69
53c25e2 @groue Revert "Filters FAQ"
authored
70 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
71
9228835 @groue Common use cases right in the README
authored
72 - **Q: How do I render default values for missing keys?**
73
74 A: This can be done by providing your template a delegate: check [Guides/delegate.md](GRMustache/blob/master/Guides/delegate.md).
75
4973f8c @groue README
authored
76 - **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
77
1d73c2b @groue GRMustacheTemplateRepository guides
authored
78 A: Check [Guides/template_repositories.md](GRMustache/blob/master/Guides/template_repositories.md).
c1bd462 @groue README
authored
79
4973f8c @groue README
authored
80 - **Q: What is this NSUndefinedKeyException stuff?**
81
82 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
83
84
85 Contribution wish-list
86 ----------------------
87
88 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
89
f5fb58f @groue wording
authored
90
c0e699e @groue wip
authored
91 Forking
92 -------
93
d8957ab @groue renamed guides to Guides
authored
94 Please fork. You'll learn useful information in [Guides/forking.md](GRMustache/blob/master/Guides/forking.md).
c0e699e @groue wip
authored
95
f5fb58f @groue wording
authored
96
e4bd74e @groue License
authored
97 License
98 -------
99
100 Released under the [MIT License](http://en.wikipedia.org/wiki/MIT_License)
101
4f1625f @groue guides
authored
102 Copyright (c) 2012 Gwendal Roué
e4bd74e @groue License
authored
103
104 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:
105
106 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
107
108 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.
109
Something went wrong with that request. Please try again.