Skip to content

duncanbeevers/jade-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jade-react

Compile Jade templates to React de-sugared JSX.

.container-fluid.readme
  .row
    h1= this.storeName
    ul
    each product in this.products
      li
        | Product
        = product.title

into

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
          );
        }
      )
    )
  );
}

About

Compile Jade templates to React.DOM expressions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published