https://github.com/duncanbeevers/jade-react
Compile Jade templates to React.DOM expressions
https://github.com/duncanbeevers/jade-react
Last synced: about 1 month ago
JSON representation
Compile Jade templates to React.DOM expressions
- Host: GitHub
- URL: https://github.com/duncanbeevers/jade-react
- Owner: duncanbeevers
- Created: 2014-01-26T04:34:35.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-02-16T20:29:34.000Z (about 11 years ago)
- Last Synced: 2024-07-31T19:27:40.425Z (9 months ago)
- Language: CoffeeScript
- Homepage:
- Size: 289 KB
- Stars: 152
- Watchers: 12
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
- awesome-react-cn - jade-react - Compile Jade templates to React.DOM expressions (Uncategorized / Uncategorized)
- awesome-react - jade-react - Compile Jade templates to React.DOM expressions
- awesome-learning-resources - jade-react - Compile Jade templates to React.DOM expressions (Uncategorized / Uncategorized)
- awesome-react - jade-react - Compile Jade templates to React.DOM expressions (React [🔝](#readme))
README
# jade-react
Compile Jade templates to React de-sugared JSX.
```jade
.container-fluid.readme
.row
h1= this.storeName
ul
each product in this.products
li
| Product
= product.title
```into
```javascript
function () {
function map (obj, fn) {
if ('number' === typeof obj.length) return obj.map(fn);
var result = [], key, hasProp = {}.hasOwnProperty;
for (key in obj) hasProp.call(obj, key) && result.push(fn(key, obj[key]));
return result;
}return React.DOM.div({
"className": "container-fluid readme"
},
React.DOM.div({
"className": "row"
},
React.DOM.h1(null,
this.storeName
),
React.DOM.ul(null),
map(this.products, function (product, $index) {
return React.DOM.li(null,
"Product",
product.title
);
}
)
)
);
}
```