groue/GRMustache
关于
适用于 macOS Cocoa 和 iOS 的灵活、可用于生产环境的 Mustache 模板
网站与应用开发实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 0
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文GRMustache
GRMustache is a Mustache template engine written in Objective-C, for both MacOS Cocoa and iOS.
It ships with built-in goodies and extensibility hooks that let you avoid the strict minimalism of the genuine Mustache language when you need it.
April 22, 2015: GRMustache 7.3.2 is out. Release notes
Get release announcements and usage tips: follow @GRMustache on Twitter.
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.
Swift developers: You can use GRMustache from Swift, with a limitation: you can only render Objective-C objects. Instead, consider using GRMustache.swift, a pure Swift implementation of GRMustache.
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 = ...
Documentation
If you don't know Mustache, start here: http://mustache.github.io/mustache.5.html
- Guides: a guided tour of GRMustache
- Reference: all classes & protocols
- Troubleshooting
- FAQ
License
Released under the MIT License.
Other Nifty Libraries
- groue/GRMustache.swift: Flexible Mustache templates for Swift 1.2 and 2.
- groue/GRDB.swift: SQLite toolkit for Swift 2.
- groue/GRValidation: Validation toolkit for Swift 2.
探索相关项目
加载中…