Permalink
Browse files

v1.10.0

  • Loading branch information...
1 parent 354d985 commit 31100d33709a85ff11b1dbc15bd43d9fef7f0d70 @groue committed Feb 15, 2012
@@ -33,7 +33,7 @@
@since v1.0
*/
-#define GRMUSTACHE_MINOR_VERSION 9
+#define GRMUSTACHE_MINOR_VERSION 10
/**
The patch-level component of GRMustache version
View
@@ -17,7 +17,7 @@ What you get
**MacOS 10.6+, iPhoneOS 3.0, iOS 4.0+ support**
-**Compatibility with other Mustache implementations**: [Mustache specification v1.1.2](https://github.com/mustache/spec) conformance, and a touch of [Handlebars.js](https://github.com/wycats/handlebars.js) (details in [guides/flavors.md](GRMustache/blob/master/guides/flavors.md)).
+**Compatibility with other Mustache implementations**: [Mustache specification v1.1.2](https://github.com/mustache/spec) conformance, and a touch of [Handlebars.js](https://github.com/wycats/handlebars.js) (see below).
**Compatibility with previous GRMustache versions**: update GRMustache, enjoy performance improvements and bugfixes, and don't change a line of your code. Check the [release notes](GRMustache/blob/master/RELEASE_NOTES.md).
@@ -30,7 +30,6 @@ What you get
- [guides/runtime.md](GRMustache/blob/master/guides/runtime.md): how to provide data to templates
- [guides/number_formatting.md](GRMustache/blob/master/guides/number_formatting.md): how to format numbers
- [guides/date_formatting.md](GRMustache/blob/master/guides/date_formatting.md): how to format dates
-- [guides/flavors.md](GRMustache/blob/master/guides/flavors.md): a word on the Mustache and Handlebars flavors
- [guides/forking.md](GRMustache/blob/master/guides/forking.md): how GRMustache is organized
Usage
@@ -60,14 +59,14 @@ Speaking of templates, GRMustache eats many kinds of them: files and bundle reso
Regarding the data objects, GRMustache fetches values with the standard Key-Value Coding `valueForKey:` method. Check [guides/runtime.md](GRMustache/blob/master/guides/runtime.md).
-Mustache flavors
-----------------
+Handlebars.js support
+---------------------
-GRMustache supports two Mustache flavors : the genuine Mustache, and a bit a [Handlebars.js](https://github.com/wycats/handlebars.js).
+[Handlebars.js](https://github.com/wycats/handlebars.js) is an extension to the Mustache templating language.
-The main difference lies in the syntax of key paths: genuine Mustache reads `{{foo.bar.baz}}`, while Handlebars reads `{{foo/bar/baz}}` and even `{{../foo/bar/baz}}`.
+GRMustache support for Handlebars is limited to the compound key paths that use the slash character `/` as a separator, such as `{{foo/bar/baz}}` and `{{../foo/bar/baz}}`.
-If your templates use such compound key paths, you should read [guides/flavors.md](GRMustache/blob/master/guides/flavors.md).
+Of course, GRMustache reads the genuine Mustache `{{foo.bar.baz}}` key paths.
Features worth noting
View
@@ -1,6 +1,12 @@
GRMustache Release Notes
========================
+## v1.10
+
+- **Improved Handlebars.js support**
+
+Now `foo/bar` and `foo.bar` syntaxes are both supported.
+
## v1.9
- **Better lambda encapsulation with classes conforming to the GRMustacheHelper protocol.**
@@ -1,4 +1,4 @@
-[up](../../../../GRMustache), [next](flavors.md)
+[up](../../../../GRMustache), [next](forking.md)
Date formatting with GRMustacheDateFormatterHelper
==================================================
@@ -11,4 +11,4 @@ It does not belong the the core GRMustache code, and as such must be imported se
Read [guides/number_formatting.md](number_formatting.md) documentation, because the principles are the same. You'll just provide a `NSDateFormatter` instead of a `NSNumberFormatter`.
-[up](../../../../GRMustache), [next](flavors.md)
+[up](../../../../GRMustache), [next](forking.md)
View
@@ -1,93 +0,0 @@
-[up](../../../../GRMustache), [next](forking.md)
-
-Mustache flavors
-================
-
-**TL;DR** Should you use compound key paths in your templates, you'd rather use the dot `"."` as a separator: `{{foo.bar}}`, and execute once, before any template processing, the following statement:
-
- // Use genuine Mustache flavor
- [GRMustache setDefaultTemplateOptions:GRMustacheTemplateOptionMustacheSpecCompatibility];
-
----
-
-GRMustache ships with two concurrent interpretations of Mustache templates:
-
-- genuine Mustache, as described by the [Mustache specification v1.1.2](https://github.com/mustache/spec)
-- [Handlebars.js](https://github.com/wycats/handlebars.js)
-
-How to choose a flavor
-----------------------
-
-The only difference so far between the two flavors implementation lies in the syntax for key paths: genuine Mustache reads `{{foo.bar.baz}}`, Handlebars reads `{{foo/bar/baz}}`, and even `{{../foo/bar/baz}}`.
-
-If your templates do not use compound key paths, you can [skip](forking.md) this guide entirely.
-
-If you are designing new templates from scratch, we encourage you writing your templates in the genuine Mustache flavor. Beware that GRMustache defaults to Handlebars: keep on reading.
-
-### Application-wide flavor
-
-If all of the templates processed by your application belong to the same flavor, consider setting the application-wide flavor with one of the following statement, prior to any template processing:
-
- // Use genuine Mustache flavor
- [GRMustache setDefaultTemplateOptions:GRMustacheTemplateOptionMustacheSpecCompatibility];
-
- // Use Handlebars flavor (the default)
- [GRMustache setDefaultTemplateOptions:GRMustacheTemplateOptionNone];
-
-### Per-template flavor
-
-Your application may have to process templates of different flavors.
-
-All GRMustache methods that are involved in template parsing have sister methods that take options as an argument.
-
-- `+[GRMustacheTemplate renderObject:fromString:error:]`
-- `+[GRMustacheTemplate renderObject:fromString:options:error:]`
-- `+[GRMustacheTemplate parseResource:bundle:error:]`
-- `+[GRMustacheTemplate parseResource:bundle:options:error:]`
-- `+[GRMustacheTemplateLoader templateLoaderWithBaseURL:]`
-- `+[GRMustacheTemplateLoader templateLoaderWithBaseURL:options:]`
-- etc.
-
-The methods with explicit options will process the template as expected:
-
- // Use genuine Mustache flavor
- [GRMustacheTemplate renderObject:...
- fromString:...
- options:GRMustacheTemplateOptionMustacheSpecCompatibility
- error:...];
-
- // Use Handlebars flavor
- [GRMustacheTemplate renderObject:...
- fromString:...
- options:GRMustacheTemplateOptionNone
- error:...];
-
-The methods with no explicit option use the default one set by `+[GRMustache setDefaultTemplateOptions:]`.
-
-Note that once a template has been parsed, you can not render it in another flavor:
-
- // Parse a Handlebars template
- GRMustacheTemplate *template = [GRMustacheTemplate parseResource:...
- bundle:...
- options:GRMustacheTemplateOptionNone
- error:...]`
-
- // Renders a Handlebars template (there is no `renderObject:options:` method):
- [template renderObject:...]
-
-Specifications coverage
------------------------
-
-### Genuine Mustache
-
-GRMustache has full coverage of [Mustache specification v1.1.2](https://github.com/mustache/spec), **except for whitespace management**.
-
-That is to say, each character of your templates will be rendered as is, whitespace included.
-
-### Handlebars
-
-[Handlebars.js](https://github.com/wycats/handlebars.js) has introduced many nifty features.
-
-Actually, GRMustache implements a single one: the syntax for key paths `{{foo/bar/baz}}` and `{{../foo/bar/baz}}`.
-
-[up](../../../../GRMustache), [next](forking.md)
@@ -136,10 +136,4 @@ And finally render:
[template1 render]; // "It works!"
[template2 render]; // "It works!"
-
-Flavors
--------
-
-Remember GRMustache supports two flavors of the Mustache language: check [guides/flavors.md](flavors.md)
-
[up](../../../../GRMustache), [next](runtime.md)
View
@@ -54,7 +54,6 @@ There are methods for rendering from strings, files, and bundle resources:
bundle:(NSBundle *)bundle // nil stands for the main bundle
error:(NSError **)outError;
-Remember GRMustache supports two flavors of the Mustache language: check [guides/flavors.md](flavors.md)
Parse-once-and-render-many-times methods
----------------------------------------
View
@@ -1,6 +1,6 @@
// The MIT License
//
-// Copyright (c) 2010 Gwendal Roué
+// Copyright (c) 2012 Gwendal Roué
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
View
@@ -1,6 +1,6 @@
// The MIT License
//
-// Copyright (c) 2010 Gwendal Roué
+// Copyright (c) 2012 Gwendal Roué
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
// The MIT License
//
-// Copyright (c) 2010 Gwendal Roué
+// Copyright (c) 2012 Gwendal Roué
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
// The MIT License
//
-// Copyright (c) 2010 Gwendal Roué
+// Copyright (c) 2012 Gwendal Roué
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
// The MIT License
//
-// Copyright (c) 2010 Gwendal Roué
+// Copyright (c) 2012 Gwendal Roué
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
// The MIT License
//
-// Copyright (c) 2010 Gwendal Roué
+// Copyright (c) 2012 Gwendal Roué
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
// The MIT License
//
-// Copyright (c) 2010 Gwendal Roué
+// Copyright (c) 2012 Gwendal Roué
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
// The MIT License
//
-// Copyright (c) 2010 Gwendal Roué
+// Copyright (c) 2012 Gwendal Roué
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
// The MIT License
//
-// Copyright (c) 2010 Gwendal Roué
+// Copyright (c) 2012 Gwendal Roué
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
// The MIT License
//
-// Copyright (c) 2010 Gwendal Roué
+// Copyright (c) 2012 Gwendal Roué
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -23,6 +23,7 @@
#import <Foundation/Foundation.h>
#import "GRMustacheAvailabilityMacros.h"
+@class GRMustacheInvocation;
/**
`GRMustacheSection` is a class that is involved in mustache lambdas definition.
@@ -167,7 +168,7 @@
*/
@interface GRMustacheSection: NSObject {
@private
- NSString *name;
+ GRMustacheInvocation *invocation;
NSString *baseTemplateString;
NSRange range;
BOOL inverted;
@@ -1,6 +1,6 @@
// The MIT License
//
-// Copyright (c) 2010 Gwendal Roué
+// Copyright (c) 2012 Gwendal Roué
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -32,7 +32,7 @@
@interface GRMustacheTemplate: NSObject {
@private
NSArray *elems;
- id contextStrategy;
+ GRMustacheTemplateOptions options;
}
//////////////////////////////////////////////////////////////////////////////////////////
@@ -1,6 +1,6 @@
// The MIT License
//
-// Copyright (c) 2010 Gwendal Roué
+// Copyright (c) 2012 Gwendal Roué
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -35,7 +35,7 @@
NSString *extension;
NSStringEncoding encoding;
NSMutableDictionary *templatesById;
- GRMustacheTemplateOptions templateOptions;
+ GRMustacheTemplateOptions options;
}
#if !TARGET_OS_IPHONE || GRMUSTACHE_IPHONE_OS_VERSION_MAX_ALLOWED >= 40000
@@ -1,6 +1,6 @@
// The MIT License
//
-// Copyright (c) 2010 Gwendal Roué
+// Copyright (c) 2012 Gwendal Roué
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
// The MIT License
//
-// Copyright (c) 2010 Gwendal Roué
+// Copyright (c) 2012 Gwendal Roué
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
// The MIT License
//
-// Copyright (c) 2010 Gwendal Roué
+// Copyright (c) 2012 Gwendal Roué
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -33,7 +33,7 @@
@since v1.0
*/
-#define GRMUSTACHE_MINOR_VERSION 9
+#define GRMUSTACHE_MINOR_VERSION 10
/**
The patch-level component of GRMustache version
View
Binary file not shown.
View
Binary file not shown.
Binary file not shown.

0 comments on commit 31100d3

Please sign in to comment.