diff --git a/README.md b/README.md index 252397d..da2c44b 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Light weight templates for react. Reasons that we love it: * Easy syntax. Similar to HTML. All IDEs recognize this format ## How does it work -React templates compiles a *.rt file (react template - extended HTML format) into a javascript file. Currently, this file supports requirejs format, that will return a function. This function, when applied, will return a virtual react DOM (based on React.DOM elements and user custom components). A common use case would be that a React component would require a JS file generated by a template, and then call ``func.apply(this)``, causing the template to have the component as its context. +React templates compiles a *.rt file (react template - extended HTML format) into a javascript file. Currently, this file supports requirejs format, that will return a function. This function, when applied, will return a virtual react DOM (based on React.DOM elements and user custom components). A common use case would be that a React component would require a JS file generated by a template, and then call `func.apply(this)`, causing the template to have the component as its context. ###### Basic concepts for react templates: * Any valid HTML is a template (and comments) @@ -69,16 +69,61 @@ define([ }); ``` -## section -Section text +## rt-repeat +Repeats a node with its subtree for each item in an array. This is implemented by creating a method that is passed to a map method as a callback. It creates a real context for the iterated variable. It will create an item*Index* variable to represent the index of the item. If the definition is "myNum in this.getMyNumbers()", than there will be 2 variables in the scope: myNum and myNumIndex Sample: ``` - +