From c6055f8628626d1a5fea2c7f3e3e54a32bd88d81 Mon Sep 17 00:00:00 2001 From: Amit Kaufman Date: Fri, 14 Nov 2014 22:20:15 +0200 Subject: [PATCH] Added summary of the entire doc (in bullet points) --- README.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index efca9b6..15861a0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,25 @@ react-templates =============== -Light weight templates for react +Light weight templates for react. Reasons that we love it: + +* No runtime libraries. No magic. Just simple pre-compilation to a clear code +* Super easy to write panels. By panels we mean components that have a lot of HTML code and non-reusable logic +* Very good separation of presentation and logic. Almost no HTML within the component file +* Declerative coding for presentation. HTML that you write and inspect look similar +* 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. + +**Basic concepts for react templates:** +* Any valid HTML is a template (and comments) +* {} to identify JS execution context +* rt-if +* rt-repeat +* rt-scope +* rt-class +* style +* event handlers +* doctype rt, require dependencies, and calling other components