Jan Lehnardt
38ca0cef68
allow using sections as context. Patch by dpree.
před 16 roky
Chris Wanstrath
e2e8f16845
Higher Order Sections
If a section key returns a function, it will be called
and passed both the unrendered block of text and a renderer
convenience function.
Given this JS:
"name": "Tater",
"bolder": function() {
return function(text, render) {
return "<b>" + render(text) + '</b>'
}
}
And this template:
{{#bolder}}Hi {{name}}.{{/bolder}}
We'll get this output:
<b>Hi Tater.</b>
As you can see, we're pre-processing the text in the block.
This can be used to implement caching, filters (like syntax
highlighting), etc.
You can use `this.name` to access the attribute `name` from
your view.
před 16 roky
Jan Lehnardt
b76120acb4
Merge remote branch 'defunkt/rake'
* defunkt/rake:
Add descriptions to rake tasks (`rake -T` to see all)
print => puts
před 16 roky
Jan Lehnardt
c1c18e7c17
start 0.3 branch
před 16 roky
Brian Kierstead
7198e2c578
simple iterator adding \n bug
před 16 roky
Chris Wanstrath
4b79a9f594
Add descriptions to rake tasks (`rake -T` to see all)
před 16 roky
Chris Wanstrath
3a2717e12e
print => puts
před 16 roky
Jan Lehnardt
ca7956565a
Move commonjs branch into master.
lib/mustache.js is now always kept in sync with mustache.js
(cc @tlrobinson , @boucher )
před 16 roky
Jan Lehnardt
9eac2ded28
Less ego
před 16 roky
Jan Lehnardt
6175dc69a6
update CHANGES
před 16 roky
Jan Lehnardt
ffa4738595
release 0.2.3
před 16 roky
Jan Lehnardt
20aa13e331
rake ain't make
před 16 roky
Jan Lehnardt
0b4ea36a9c
thanks will, qoobaa
před 16 roky
Jan Lehnardt
baeab34a25
less hacky, thanks will
před 16 roky
Jakub Kuźma
420dd04143
added YUI3 support
před 16 roky
Jan Lehnardt
4694868fdc
don't barf on undefined partial contexts, return the verbatim partial instead
před 16 roky
Jan Lehnardt
2c8857e84a
remove extra semicolon
před 16 roky
Jan Lehnardt
9e2fc30e28
thanks dmathieu, undupe jchris
před 16 roky
Jan Lehnardt
eaaae4696b
clean up tests
před 16 roky
Jan Lehnardt
d9ab0b0041
Revert "Parse pragmas only once"
This reverts commit 738de0bcae .
Conflicts:
mustache.js
před 16 roky
Damien Mathieu
2d574f70dc
add a (failing for now) example of loop inside a partial
před 16 roky
Jakub Kuźma
5c3a177662
fixed semicolons, added var to 'i' global variable
před 16 roky
Jan Lehnardt
cb39d246df
throw exception when encountering an unknown pragma
před 16 roky
Chris Wanstrath
8bb475bf4b
Fix broken link, mention manpages and docs.
před 16 roky
Jan Lehnardt
5b9a0e5ee9
thanks jchris
před 16 roky
Jan Lehnardt
272fd0fc1f
fix test case
před 16 roky
Jan Lehnardt
938f6cf0b6
return!
před 16 roky
Chris Anderson
a354b55156
more send fun goodness
před 16 roky
Chris Anderson
f864a27cb9
make the tests also test a generic send function (reveals failures)
před 16 roky
Jan Lehnardt
3944cfc8cc
Don't join and return the buffer with custom send functions.
před 16 roky
Jan Lehnardt
17fa3c7b89
typo
před 16 roky
Jan Lehnardt
2d726ac953
update CHANGES
před 16 roky
Jan Lehnardt
d0f6845451
document pragmas
před 16 roky
Jan Lehnardt
03c673b635
whitespace pedantery
před 16 roky
Jan Lehnardt
a7b3c0b614
add beard competition
před 16 roky
Jan Lehnardt
738de0bcae
Parse pragmas only once
před 16 roky
Jan Lehnardt
da2df02ede
Merge commit 'glytch/master'
* commit 'glytch/master':
tests for null value change
don't die on null values
před 16 roky
Jan Lehnardt
b1cd428dd6
Merge branch 'master' of git@github.com:janl/mustache.js
* 'master' of git@github.com:janl/mustache.js:
don't die on null values
před 16 roky
Elise Wood
6324de20c6
tests for null value change
před 16 roky
Jan Lehnardt
f841fac792
thanks glytch
před 16 roky
Elise Wood
9cc393b328
don't die on null values
před 16 roky
Elise Wood
6d6218b713
don't die on null values
před 16 roky
Jan Lehnardt
44f28016e2
Merge branch 'master' of git@github.com:janl/mustache.js
* 'master' of git@github.com:janl/mustache.js:
Damnit Janet.
před 16 roky
Jan Lehnardt
dae2c7af49
More explicit error message: Tell which parital is unknown.
před 16 roky
Jan Lehnardt
0b2dcc5531
Damnit Janet.
před 16 roky
Jan Lehnardt
6e1838500b
Thanks Nikita
před 16 roky
Jan Lehnardt
195fa9e255
Better isArray implementation via
62efd014fc (comments)
Thanks Nikita!
před 16 roky
Jan Lehnardt
62efd014fc
more robust type detection, thanks again Doug
před 16 roky
Jan Lehnardt
70fdf9f2a0
roll 0.2.2
před 16 roky
Jan Lehnardt
88ddf16cec
allow tag-free templates. Closes http://github.com/janl/mustache.js/issues#issue/9
před 16 roky