• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

groue/GRMustache: Flexible and production-ready Mustache templates for MacOS Coc ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

groue/GRMustache

开源软件地址(OpenSource Url):

https://github.com/groue/GRMustache

开源编程语言(OpenSource Language):

Objective-C 71.7%

开源软件介绍(OpenSource Introduction):

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

License

Released under the MIT License.

Other Nifty Libraries




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap