From c2b1b530160403ef1cef8438b3c982c1080f8981 Mon Sep 17 00:00:00 2001 From: Ziang Song Date: Fri, 15 Feb 2013 12:50:18 -0500 Subject: [PATCH] Update README.md --- README.md | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index daebaee..15cd962 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,38 @@ Kiwi ==== -Kiwi is a javascript module which can do string interpolation. \ No newline at end of file +Kiwi is a javascript module which can do string interpolation. + +Example +=== + + * API + +```javascript +Kiwi.compose(, ); +``` + + * Use **% (percentage symbol)** as the place holder. + +```javascript + +var input = "The quick brown % jumps over the lazy %."; +var result = Kiwi.compose(input, ["fox", "dog"]); +console.log(result); + +//Output: The quick brown fox jumps over the lazy dog. + +``` + + * Use **` (Grave accent symbol)** to escape the % symbol. + +```javascript + +var input = "The % is 50'%."; +var result = Kiwi.compose(input, ["chance"]); +console.log(result); + +//Output: The chance is 50%. + +``` +