Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updating readme examples

  • Loading branch information...
commit 7c25f2c8efa91b1be1eac88aa18a5fc2b28a754a 1 parent 2035329
@addyosmani authored
Showing with 19 additions and 18 deletions.
  1. +19 −18 README.md
View
37 README.md
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.