Commit Graph

209 Commits

Author SHA1 Message Date
Michael Bayne 20abde5b1a Expose the context to a lambda fragment.
This allows the lambda to take the context and turn around and render it using
a totally different template, if desired.
2014-04-16 14:26:22 -07:00
Michael Bayne 5bb76b0b51 Use latest sbt-pom-util plugin. 2014-04-16 14:26:07 -07:00
Michael Bayne 3c0c0f5b4a Yet more edits. 2014-03-31 10:02:15 -07:00
Michael Bayne 69c832a3ac More edits. 2014-03-31 10:01:15 -07:00
Michael Bayne a5a30fe5dc Minor edits. 2014-03-31 10:00:00 -07:00
Michael Bayne ec38ae2c80 Added details on thread-safety. 2014-03-31 09:57:42 -07:00
Michael Bayne 199ebf1f84 Use a copy of delims in the parser.
I don't know what madness overcame me when I thought it was a good idea to
mutate the compiler's delims during parsing and then restore them.
2014-03-31 09:41:02 -07:00
Michael Bayne 5ca07f70f0 Widened README to 100 columns.
Not sure why I had it at 80 before, though maybe I'm about to find out when I
push and the formatting is all hosed.
2014-03-18 09:29:30 -07:00
Michael Bayne 9861b54aa0 Formatting, and small javadoc improvement. 2014-03-18 09:26:38 -07:00
robbytx 75609b42df Add ability for lambda to change the context for fragment execution 2014-03-14 09:50:19 -05:00
Michael Bayne 3fe5e020d8 Factor exception wrapped read() into nextChar(). 2014-03-12 11:35:45 -07:00
Michael Bayne 8998b5f11e May as well report the bogus final char if we can. 2014-03-12 11:31:16 -07:00
Michael Bayne d1c8a665a9 Also, why add a brace and then remove it? 2014-03-12 11:23:16 -07:00
robbytx 5c3a93e079 Correct number of braces for error message 2014-03-12 11:21:17 -07:00
Michael Bayne df1cf9286f Override is good in code, a distraction in docs. 2014-03-11 07:47:11 -07:00
Michael Bayne b44e36f6c3 Invertable -> invertible here too. 2014-03-11 07:45:47 -07:00
Michael Bayne 59e06b24c9 Invertable -> invertible. Other minor tidying. 2014-03-11 07:43:44 -07:00
robbytx 2251ac1ed2 Add support for lambdas in inverse blocks 2014-03-10 17:06:21 -05:00
Michael Bayne aafa5c0a73 Update to more recent compiler plugin.
Also bumped source/target to 1.6. Hopefully this won't result in backlash from
cavemen still using JMustache on JDK 1.5.
2014-02-17 12:06:42 -08:00
Michael Bayne 93b66b757e More test coverage plus Coveralls wiring. 2014-02-17 12:02:41 -08:00
Michael Bayne 6b866d3263 Try wiring up Coveralls Maven plugin. 2014-02-17 11:54:17 -08:00
Michael Bayne 50416be2dc Reference 1.9 release. 2014-02-13 10:19:04 -08:00
Michael Bayne b618e6dbd4 [maven-release-plugin] prepare for next development iteration 2014-02-13 10:16:36 -08:00
Michael Bayne 834759d04c [maven-release-plugin] prepare release jmustache-1.9 2014-02-13 10:16:32 -08:00
Michael Bayne aaa4287837 Merge pull request #47 from egaga/patch-1
fixed documentation typo: reference `this´ instead of `self´
2014-01-29 10:28:54 -08:00
egaga b7a1a8c991 reference this´ instead of self´ 2014-01-29 13:51:02 +02:00
Michael Bayne 9d74bbd162 Added test for custom formatter. 2014-01-08 11:17:19 -08:00
Michael Bayne 4bd3410207 Fixed typo in docs. 2014-01-08 11:02:29 -08:00
Michael Bayne e80aab2a67 Fixed insufficient indentation. 2014-01-08 11:01:56 -08:00
Michael Bayne 12a4b77107 Fixed docs on Escaper, added docs for Formatter. 2014-01-08 10:59:37 -08:00
Michael Bayne acc339ee13 Added mechanism to customize toString-ing of values. 2014-01-08 10:50:37 -08:00
Michael Bayne 9372c7009e Cache a NOT_FOUND_FETCHER when no fetcher is found.
Closes #45.

This avoids the expensive process of repeatedly looking for a fetcher in a
context where one doesn't exist.
2014-01-02 11:24:36 -08:00
Michael Bayne 19516ff1e4 Updated nullValue docs to be correct re: Map. 2013-10-08 12:26:39 -07:00
Michael Bayne 5001469052 Updated docs for Compiler.nullValue(). 2013-10-08 12:21:54 -07:00
Michael Bayne 9910bb691a SBT updates, fixed GWT test depends. 2013-10-08 12:18:48 -07:00
Michael Bayne 6cfc376e8d Rewrote array/list fetch-by-index using collectors.
That's what collectors are for. This also avoids the needless expense of doing
Integer.parseInt on every single key (the vast majority of which will not
actually be numbers), every single time we do a context lookup.
2013-10-07 14:25:58 -07:00
Mickael Jeanroy 98c7a5d38f Access Array item by index in template 2013-10-06 10:06:48 +02:00
Michael Bayne 3af55c2660 Some javadoc improvements. 2013-08-01 16:04:46 -07:00
Michael Bayne 426f1698e0 Fixed source headers. 2013-08-01 16:01:31 -07:00
Michael Bayne d1384cd049 Reworked user-defined escaping to suit my tastes. 2013-08-01 16:01:31 -07:00
Nat Pryce 0797c89c38 Fixed formatting in README 2013-07-22 22:46:29 +01:00
Nat Pryce 30907579eb README describes user-extensible escaping rules (not just HTML or no escaping) 2013-07-22 22:45:28 +01:00
Nat Pryce 4ae290fdaa User-extensible escaping rules (not just HTML or no escaping) 2013-07-22 22:36:51 +01:00
Michael Bayne 9441d062a6 Moved falsey-ness detection into compiler.
Fixes #39.

This fixes a bug where falsey values were not properly triggering inverted
sections, and consolidates some logic.

Also did some renaming. Couldn't help myself.
2013-07-03 16:48:09 -07:00
Michael Bayne 6e3051c3ba Some tidying, added a negative test, method tests.
The latter was because the new feature was not actually conditional on its
compiler parameter. It was on all the time.
2013-05-13 13:22:45 -07:00
Mickael Jeanroy 4300b1213e Add option to treat zero as a falsy value
In javascript implementation, zero is a falsy value and is treated as a false boolean.
An option is added (false by default) to treat zero as a falsy value as in javascript implementation.

It means that section like:

{{#zeroValue}}foo{{/zeroValue}}

will not be rendered.
2013-05-08 22:24:40 +02:00
Michael Bayne 426faf92c5 Do our save/restore slightly differently. 2013-05-03 10:12:00 -07:00
David Loehr 751f671fd6 Reset compiler.delims after parsing a template 2013-05-03 11:57:53 -04:00
Michael Bayne 158b34f041 Update links to 1.8 artifact. 2013-04-05 11:07:41 -07:00
Michael Bayne 3baec8221d [maven-release-plugin] prepare for next development iteration 2013-04-05 11:03:35 -07:00