Permalink
Browse files

updating readme examples

  • Loading branch information...
1 parent 2035329 commit 7c25f2c8efa91b1be1eac88aa18a5fc2b28a754a @addyosmani committed May 14, 2011
Showing with 19 additions and 18 deletions.
  1. +19 −18 README.md
View
@@ -2,24 +2,7 @@ A very compact micro-templating solution created for learning purposes. Currentl
### Sample usage
-Example 1: Basic templating
-
-```javascript
- var markup1 = "Test 1: I am a {{user.age}} year old {{user.sex}} from {{country}}",
- data1 = {
- country: "Ireland",
- user: {
- age: 25,
- name: "Addy",
- sex: "male"
- }
- };
-
- alert(templatez(markup1, data1));
-```
-
-
-Example 2: Populating a separately defined template
+Example 1: Populating a separately defined template
```javascript
<script type="text/micro" id="test">
@@ -40,6 +23,24 @@ Example 2: Populating a separately defined template
```
+Example 2: Basic inline templating
+
+```javascript
+ var markup1 = "Test 1: I am a {{user.age}} year old {{user.sex}} from {{country}}",
+ data1 = {
+ country: "Ireland",
+ user: {
+ age: 25,
+ name: "Addy",
+ sex: "male"
+ }
+ };
+
+ alert(templatez(markup1, data1));
+```
+
+
+
Example 3: Templating a multi-dimensional array
```javascript

0 comments on commit 7c25f2c

Please sign in to comment.