diff --git a/README.md b/README.md index 57e2973..04b07ff 100644 --- a/README.md +++ b/README.md @@ -30,12 +30,22 @@ http://wix.github.io/react-templates/ ###### Why not use JSX? Some love JSX, some don't. We don't. More specifically, it seems to us that JSX is a good fit only for components with very little HTML inside, which can be accomplished by creating elements in code. Also, we like to separate code and HTML. It just feels right. +## Installation +You can install ESLint using npm: +```shell +npm install git+ssh://git@github.com:wix/react-templates -g +``` + ## Usage +```shell +rt [file.rt|dir]* [options] +``` + **src/cli.js < filename.rt >** -*(you might need to provide execution permission to the file)* +*(you might need to provide execution permission to the file)* ? Note that in most cases, this package will be wrapped in a Grunt task, so that cli will not be used explicitly. -TODO: pointer to the Grunt repository +[grunt-react-templates](https://github.com/wix/grunt-react-templates) # Template directives and syntax @@ -300,3 +310,6 @@ define([ }; }); ``` + +## License +Copyright (c) 2014 Wix. Licensed under the MIT license. diff --git a/fiddle.html b/fiddle.html index 98036e1..3c44ffe 100644 --- a/fiddle.html +++ b/fiddle.html @@ -27,9 +27,6 @@ - - - diff --git a/index.html b/index.html index 7dceab1..7eb66b9 100644 --- a/index.html +++ b/index.html @@ -74,7 +74,7 @@
RTFiddle - Download React v0.12.1 +
@@ -119,26 +119,26 @@

-
-
- Get Started - Download React v0.12.1 -
-

+ + + + + + - + + + + + + + + + +
diff --git a/playground/playground.js b/playground/playground.js index 6fa1164..c75bf2b 100644 --- a/playground/playground.js +++ b/playground/playground.js @@ -52,23 +52,8 @@ define(['react', 'lodash', './playground-fiddle.rt', './playground.rt'], functio }; } - //var z = {getInitialState: function () {return {name: 'reactTemplates'};}}; - //var templateHTML = '
\n' + - // 'Have {_.filter(this.state.todos, {done:true}).length} todos done,\n' + - // 'and {_.filter(this.state.todos, {done:false}).length} not done\n' + - // '
\n' + - // '
\n' + - // ' \n' + - // ' \n' + - // ' {todo.value}\n' + - // '
\n' + - // ' \n' + - // '
\n' + - // ' \n' + - // '
'; var templateHTML = '
'; var templateProps = '{}'; - //var templateProps = "{\n mixins: [React.addons.LinkedStateMixin],\n getInitialState: function () {\n return {edited: '', todos: [], counter: 0};\n },\n add: function () {\n if (this.state.edited.trim().length === 0) {\n return;\n }\n var newTodo = {value: this.state.edited, done: false, key: this.state.counter};\n this.setState({todos: this.state.todos.concat(newTodo), edited: '', counter: this.state.counter + 1});\n },\n remove: function (todo) {\n this.setState({todos: _.reject(this.state.todos, todo)});\n },\n toggleChecked: function (index) {\n var todos = _.cloneDeep(this.state.todos);\n todos[index].done = !todos[index].done;\n this.setState({todos: todos});\n },\n clearDone: function () {\n this.setState({todos: _.filter(this.state.todos, {done: false})});\n }\n}"; var Playground = React.createClass({