react-magic icon indicating copy to clipboard operation
react-magic copied to clipboard

Allow pipe from cli

Open jchoi2x opened this issue 8 years ago • 1 comments

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

jchoi2x avatar Dec 27 '17 01:12 jchoi2x

Deploy preview ready!

Built with commit 1c9b1ad9df3772bac2e277ebdbe2f012b333f3d1

https://deploy-preview-151--react-magic.netlify.com

DanBuild avatar Dec 27 '17 01:12 DanBuild