GitXplorerGitXplorer
c

reshape-components

public
3 stars
0 forks
20 issues

Commits

List of commits on branch master.
Unverified
7312426c4f1d957651ec86d49e53bd1ce71ef8fc

Update @commitlint/config-angular to the latest version 🚀 (#23)

ggreenkeeper[bot] committed 7 years ago
Unverified
d0ab000b9e204af541917824a7cb19314a927f3c

Update @commitlint/cli to the latest version 🚀 (#22)

ggreenkeeper[bot] committed 7 years ago
Unverified
9c1f13f814d427a18c723a267c225f85b08f8cf6

Update @commitlint/cli to the latest version 🚀 (#20)

ggreenkeeper[bot] committed 7 years ago
Unverified
55500cd00496842939ab07e69dbb3dc840eaa191

chore(package): update semantic-release to version 11.0.2 (#19)

ggreenkeeper[bot] committed 7 years ago
Unverified
921a8a385e49cc4715ec2282e675674a4094b603

Update jest to the latest version 🚀 (#18)

ggreenkeeper[bot] committed 7 years ago
Unverified
d6e34cd626cb8896b8f5a59ccc5a588b2cdf1f2f

Update babel-jest to the latest version 🚀 (#17)

ggreenkeeper[bot] committed 7 years ago

README

The README file for this repository.

Reshape Components

Build Status codecov Greenkeeper badge

Usage

Input:

foobar.html

<div class="g-foobar">
  <h1>This is a foobar called {{ props.title }}</h1>
  {{{ props.children }}}
  <h2>otherProp is {{ props.otherprop }}</h2>
</div>

main.html

<Import src="./foobar.html" as="FooBar"/>
<FooBar title="this is the title" otherProp="5">
  <p>Child Here</p>
</FooBar>

Processed as such:

const { readFileSync } = require('fs')
const reshape = require('reshape')
const components = require('reshape-components')
const expressions = require('reshape-expressions')

const main = readFileSync('main.html')

reshape({ plugins: [components(), expressions()] })
  .process(main)
  .then((result) => console.log(result.output()))

Results in:

<div class="g-foobar">
  <h1>This is a foobar called "this is the title"</h1>
  <p>Child Here</p>
  <h2>otherProp is 5</h2>
</div>

Installation

NPM

npm i -s reshape-components

Yarn

yarn add reshape-components

License: License: MIT

Copyright 2017 Caleb Eby

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.