react-magic
react-magic copied to clipboard
Allow pipe from cli
Added ability to take input from stdin so that html can be piped in.
Executing
cat test/test.htm | htmltojsx --className 'Tst'
results in same output as
htmltojsx -c 'Tst' ./test/test.htm
var Tst = React.createClass({
render: function() {
return (
<div>
<meta httpEquiv="Content-Type" charSet="UTF-8" />
<title>React-Magic Tests</title>
<link rel="stylesheet" type="text/css" href="http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.0.0/jasmine.css" />
{/* Source files */}
{/* Spec files */}
</div>
);
}
});
Executing echo '<div><p>fun in the sun?</p></div>' | htmltojsx --className 'Tst' results in
var Tst = React.createClass({
render: function() {
return (
<div><p>fun in the sun?</p></div>
);
}
});
Deploy preview ready!
Built with commit 1c9b1ad9df3772bac2e277ebdbe2f012b333f3d1
https://deploy-preview-151--react-magic.netlify.com