Bladeren bron

add docs for the streaming API

tags/0.2.2
Jan Lehnardt 16 jaren geleden
bovenliggende
commit
95509c585b
3 gewijzigde bestanden met toevoegingen van 9 en 2 verwijderingen
  1. +1
    -1
      CHANGES.md
  2. +7
    -0
      README.md
  3. +1
    -1
      mustache.js

+ 1
- 1
CHANGES.md Bestand weergeven

@@ -1,7 +1,7 @@
# mustache.js Changes # mustache.js Changes


## 0.2 (??-??-????) ## 0.2 (??-??-????)
* add streaming api
* ctemplate compat: Partials are indicated by >, not <. * ctemplate compat: Partials are indicated by >, not <.
* Add support for {{%PRAGMA}} to enable features. * Add support for {{%PRAGMA}} to enable features.
* Made array of strings an option. Enable with `{{%JSTACHE-ENABLE-STRING-ARRAYS}}`. * Made array of strings an option. Enable with `{{%JSTACHE-ENABLE-STRING-ARRAYS}}`.


+ 7
- 0
README.md Bestand weergeven

@@ -91,6 +91,13 @@ mustache.js does escape all values when using the standard double mustache synta


Example: Using `{{variable}}` inside a template for `5 > 2` will result in `5 &gt; 2`, where as the usage of `{{{variable}}}` will result in `5 > 2`. Example: Using `{{variable}}` inside a template for `5 > 2` will result in `5 &gt; 2`, where as the usage of `{{{variable}}}` will result in `5 > 2`.


## Streaming
To stream template results out of mustache.js, you can pass an optional `send()` callback to the `to_html()` call:

Mustache.to_html(template, view, partials, function(line) {
print(line);
});



## More Examples and Documentation ## More Examples and Documentation
See `examples/` for more goodies and read the [original mustache docs][m] See `examples/` for more goodies and read the [original mustache docs][m]


+ 1
- 1
mustache.js Bestand weergeven

@@ -265,7 +265,7 @@ var Mustache = function() {


return({ return({
name: "mustache.js", name: "mustache.js",
version: "0.3a",
version: "0.2a",


/* /*
Turns a template and view into HTML Turns a template and view into HTML


Laden…
Annuleren
Opslaan