sindresorhus/capture-website-cli

Allow direct HTML input

fisker opened this issue · 5 comments

Before I start, there is something I want cofirm,

If we add the same flag --input-type like capture-website will ask people use like

capture-website "<h1>awsome</h1>" screenshot.png --input-type html

I think this flag might not easy to use, I suggest we use --html boolean flag, this will be easier to user

capture-website "<h1>awsome</h1>" screenshot.png --html

And we should probably support stdin, so we can

curl https://www.google.com | capture-website screenshot.png --html
cat my.html | capture-website --html > screenshot.png

There might be confusion to support stdin

cat myfile | capture-website screenshot.png --html
  1. capture-website string screenshot.png and output to stdout
  2. capture-website string from myfile and output to screenshot.png

It's not clear.

Add --filename or --output ?

Let's change it to a --output flag for all uses. I don't think we need a --html flag. We just make stdin be the only way to input raw HTML.

So this will be how you use it:

echo '<h1>dad</h1>' | capture-website --output=screenshot.png
capture-website myfile.html --output=screenshot.png

OK