• Stars
    star
    1,443
  • Rank 32,613 (Top 0.7 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created about 14 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Flexible and production-ready Mustache templates for MacOS Cocoa and iOS

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

More Repositories

1

GRDB.swift

A toolkit for SQLite databases, with a focus on application development
Swift
6,844
star
2

GRMustache.swift

Flexible Mustache templates for Swift
Swift
598
star
3

Semaphore

A Synchronization Primitive for Swift Concurrency
Swift
511
star
4

CombineExpectations

Utilities for tests that wait for Combine publishers
Swift
251
star
5

GRDBCombine

GRDB ❀️ Combine
223
star
6

GRDBQuery

The SwiftUI companion for GRDB
Swift
216
star
7

SortedDifference

A general sequence diffing algorithm, with a very specific purpose
Swift
56
star
8

GRDBSnapshotTesting

The snapshot testing library for GRDB
Swift
32
star
9

CombineTraits

Combine Publishers with Guarantees
Swift
25
star
10

GRDBObjc

FMDB-compatible bindings to GRDB.swift
Objective-C
20
star
11

WWDCCompanion

A demo app for full text search with GRDB.swift
Swift
18
star
12

GRDBCollections

Support for large result sets with GRDB
Swift
9
star
13

GRDBDemo

An iOS app that demonstrates the SQLite library GRDB and its FetchedRecordsController
9
star
14

GRValidation

Validation toolkit for Swift 2
Swift
8
star
15

GRDBDiff

Diff algorithms for SQLite, based on GRDB
Swift
5
star
16

CocoaHeadsDemo

Swift
4
star
17

GRMustacheSPM

A Swift package that uses GRMustache.swift
Swift
2
star
18

CSQLite

C
1
star
19

ARTemplating

Very simplistic performance comparison of mustache.js in a UIWebView and GRMustache
Objective-C
1
star
20

GRDBIssue636

Reproducible crash reported in https://github.com/groue/GRDB.swift/issues/636
Swift
1
star
21

SE-0235

A playground which explores SE-0235: https://forums.swift.org/t/se-0235-add-result-to-the-standard-library/17752
Swift
1
star
22

GRMustacheBenchmark

GRMustache Benchmarks
Objective-C
1
star