Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

README: thereifixedit

  • Loading branch information...
commit b9ad7eb6c0c7840fa93a81d781e24aefd1fe2013 1 parent 82f0912
Astro authored

Showing 1 changed file with 26 additions and 24 deletions. Show diff stats Hide diff stats

  1. +26 24 README.md
50 README.md
Source Rendered
... ... @@ -1,21 +1,22 @@
1 1 # [dynamictemplate](http://dodo.github.com/node-dynamictemplate/)
2 2
3   -Yet another template engine, but this time loaded with full async support and
4   -capable of being changed even after the template was rendered.
  3 +[dynamictemplate](http://dodo.github.com/node-dynamictemplate/) is yet
  4 +another template engine, but this time loaded with full async support
  5 +and capable of being changed even after the template was rendered.
5 6
6   -workz in browser too (but requires jquery).
  7 +It works in browsers too (requires JQuery).
7 8
8   -→ [check out the demo](http://dodo.github.com/node-dynamictemplate/example/list.html)
  9 +→ [Check out the demo!](http://dodo.github.com/node-dynamictemplate/example/list.html)
9 10
10   -## installation
  11 +## Installation
11 12
12 13 ```bash
13 14 $ npm install dynamictemplate
14 15 ```
15 16
16   -## documentation
  17 +## Documentation
17 18
18   -### Template
  19 +### Writing templates
19 20
20 21 ```coffeescript
21 22 tpl = new Template schema:'xml', doctype:off, pretty:off, encoding:'utf-8', end:on, -> # default settings
@@ -23,33 +24,33 @@ tpl = new Template schema:'xml', doctype:off, pretty:off, encoding:'utf-8', end:
23 24 @$tag 'child', "content"
24 25 ```
25 26
26   -this actually allows you to write real template with [asyncxml](https://github.com/dodo/node-asyncxml).
27   -normally asyncxml just gives you the ability to write asyncronious xml generation.
  27 +This actually allows you to write real templates with [asyncxml](https://github.com/dodo/node-asyncxml).
  28 +Normally, asyncxml just gives you the ability to write asynchronous XML-generating code.
28 29
29   -### how to write tags
  30 +### How to write tags
30 31
31   -maybe the main difference to some other template engines is that all the tags are asyncronious.
32   -this has the side effect that every tag has to be closed manually. this can get a little bit anoying when you write very large templates. that's why i added a little shortcut which ivokes the end for you at the and of the children scope:
  32 +Maybe the main difference to some other template engines is that all the tags are asynchronous.
  33 +This has the side effect that every tag has to be closed manually. As this can get a little bit anoying when you write very large templates, I added a little shortcut which invokes the end for you at the and of the child scope:
33 34
34 35 ```coffeescript
35 36 @html ->
36 37 @body("content").end()
37 38 @end()
38 39
39   -# is the exact same
  40 +# is the exactly same as
40 41
41 42 @$html 'xml', ->
42 43 @$body "content"
43 44 ```
44 45
45   -just add a `$` infront of the tag method and it is a little bit more sync again.
  46 +Just add a dollar sign (`$`) in front of the tag method and it acts a little bit more synchronous again.
46 47
47   -### adapters
  48 +### Adapters
48 49
49   -dynamictemplate has a similar approach like [backbone.js](http://documentcloud.github.com/backbone/) where you can choose your own backend of your models, collections or in this case templates.
  50 +dynamictemplate has a similar approach like [Backbone.js](http://documentcloud.github.com/backbone/) where you can choose your own backend of models, collections or, in this case, templates.
50 51
51 52
52   -currently only the [jquery adapter](https://github.com/dodo/node-dynamictemplate/blob/master/src/dynamictemplate-jquery.coffee) is available:
  53 +Currently only the [JQuery adapter](https://github.com/dodo/node-dynamictemplate/blob/master/src/dynamictemplate-jquery.coffee) is available:
53 54
54 55 ```html
55 56 <script src="dynamictemplate-jquery.browser.js"></script>
@@ -58,7 +59,7 @@ currently only the [jquery adapter](https://github.com/dodo/node-dynamictemplate
58 59 </script>
59 60 ```
60 61
61   -just throw your template in it and add it to the DOM when it's ready:
  62 +Just throw your template in and add it to the DOM when it's ready:
62 63
63 64 ```javascript
64 65 var tpl = jquerify(template(mydata));
@@ -67,20 +68,21 @@ tpl.on('end', function () {
67 68 });
68 69 ```
69 70
70   -### the dynamic part
  71 +### The dynamic part
71 72
72 73 TODO i couldnt find the time to build an example
73 74 that's works best with dynamictemplate, so please stand by.
74 75
75 76
76   -#### just fyi
77   -this is not finished yet.
78   -but please, make yourself comfortable, take a cookie and **start contributing**!
  77 +#### Just FYI
79 78
  79 +This is not finished yet.
  80 +But please, make yourself comfortable, take a cookie and **start contributing**!
80 81
81   -## example
82 82
83   -if you are familiar with [coffeekup](http://coffeekup.org), you should recognize this:
  83 +## Example
  84 +
  85 +If you are familiar with [coffeekup](http://coffeekup.org), you should recognize this:
84 86
85 87 ```coffeescript
86 88 stringify = (func) -> func.toString()

0 comments on commit b9ad7eb

Please sign in to comment.
Something went wrong with that request. Please try again.