From 419654cfa180e321f2ac1a0d031ff195ec26d2f9 Mon Sep 17 00:00:00 2001 From: dthree Date: Mon, 31 Aug 2015 18:57:26 -0700 Subject: [PATCH] added pageres :fire: --- config/config.json | 4 +- config/index.json | 2 +- docs/pageres/dest.md | 10 +++ docs/pageres/index.detail.md | 111 ++++++++++++++++++++++++++++++ docs/pageres/index.install.md | 3 + docs/pageres/index.md | 18 +++++ docs/pageres/on.md | 11 +++ docs/pageres/options/cookies.md | 11 +++ docs/pageres/options/crop.md | 9 +++ docs/pageres/options/delay.md | 11 +++ docs/pageres/options/filename.md | 21 ++++++ docs/pageres/options/format.md | 12 ++++ docs/pageres/options/headers.md | 9 +++ docs/pageres/options/hide.md | 9 +++ docs/pageres/options/password.md | 9 +++ docs/pageres/options/scale.md | 9 +++ docs/pageres/options/selector.md | 9 +++ docs/pageres/options/userAgent.md | 12 ++++ docs/pageres/options/username.md | 9 +++ docs/pageres/run.md | 11 +++ docs/pageres/src.detail.md | 33 +++++++++ docs/pageres/src.md | 10 +++ 22 files changed, 340 insertions(+), 3 deletions(-) create mode 100755 docs/pageres/dest.md create mode 100755 docs/pageres/index.detail.md create mode 100755 docs/pageres/index.install.md create mode 100755 docs/pageres/index.md create mode 100755 docs/pageres/on.md create mode 100755 docs/pageres/options/cookies.md create mode 100755 docs/pageres/options/crop.md create mode 100755 docs/pageres/options/delay.md create mode 100755 docs/pageres/options/filename.md create mode 100755 docs/pageres/options/format.md create mode 100755 docs/pageres/options/headers.md create mode 100755 docs/pageres/options/hide.md create mode 100755 docs/pageres/options/password.md create mode 100755 docs/pageres/options/scale.md create mode 100755 docs/pageres/options/selector.md create mode 100755 docs/pageres/options/userAgent.md create mode 100755 docs/pageres/options/username.md create mode 100755 docs/pageres/run.md create mode 100755 docs/pageres/src.detail.md create mode 100755 docs/pageres/src.md diff --git a/config/config.json b/config/config.json index d2fbce4..bc0d7fd 100755 --- a/config/config.json +++ b/config/config.json @@ -2,6 +2,6 @@ "remoteDocUrl": "https://raw.githubusercontent.com/dthree/wat/master/docs/", "remoteConfigUrl": "https://raw.githubusercontent.com/dthree/wat/master/config/", "remoteArchiveUrl": "https://api.github.com/repos/dthree/wat/tarball", - "docIndexLastWrite": "2015-09-01T01:04:24.425Z", - "docIndexSize": 3636 + "docIndexLastWrite": "2015-09-01T01:56:50.505Z", + "docIndexSize": 4125 } \ No newline at end of file diff --git a/config/index.json b/config/index.json index a6416bf..7183ab1 100755 --- a/config/index.json +++ b/config/index.json @@ -1 +1 @@ -{"vorpal":{"delimiter":{"__basic":239},"exec":{"__basic":566},"find":{"__basic":293},"index":{"__install":32,"__basic":658},"pipe":{"__basic":316},"show":{"__detail":1180,"__basic":143},"use":{"__basic":366},"session":{"delimiter":{"__basic":302},"index":{"__basic":255},"log":{"__basic":311},"prompt":{"__basic":629}},"on":{"client_command_error":{"__basic":79},"client_command_executed":{"__basic":82},"client_keypress":{"__basic":74},"client_prompt_submit":{"__basic":72},"command_registered":{"__basic":77},"index":{"__basic":592}},"mode":{"action":{"__basic":753},"delimiter":{"__basic":389},"index":{"__basic":477},"init":{"__detail":1176,"__basic":566}},"command":{"alias":{"__basic":209},"autocompletion":{"__detail":1623,"__basic":501},"description":{"__basic":221},"hidden":{"__basic":210},"index":{"__basic":467},"option":{"__basic":633},"remove":{"__basic":233},"action":{"index":{"__basic":177}}}},"vantage":{"auth":{"__detail":2836,"__basic":331},"banner":{"__basic":650},"index":{"__install":36,"__basic":1021},"listen":{"__detail":2488,"__basic":421},"on":{"client_command_error":{"__basic":80},"client_command_executed":{"__basic":83},"client_connect":{"__basic":67},"client_connect_error":{"__basic":73},"client_disconnect":{"__basic":70},"client_error":{"__basic":65},"client_keypress":{"__basic":75},"client_prompt_submit":{"__basic":73},"command_registered":{"__basic":78},"index":{"__basic":1089},"server_command_received":{"__basic":76},"server_connection":{"__basic":70},"server_disconnect":{"__basic":70}},"firewall":{"accept":{"__basic":349},"index":{"__basic":407},"policy":{"__basic":360},"reject":{"__basic":344}}},"robotjs":{"getMousePos":{"__basic":125},"getPixelColor":{"__basic":145},"getScreenSize":{"__basic":148},"index":{"__install":409,"__basic":261},"keyTap":{"__basic":292},"keyToggle":{"__basic":456},"mouseClick":{"__detail":187,"__basic":187},"mouseToggle":{"__basic":322},"moveMouse":{"__basic":180},"moveMouseSmooth":{"__basic":201},"setKeyboardDelay":{"__basic":132},"setMouseDelay":{"__basic":116},"typeString":{"__basic":147}},"js":{"json":{"stringify":{"__basic":363}},"array":{"concat":{"__basic":330},"entries":{"__basic":251},"every":{"__basic":259},"fill":{"__basic":183},"filter":{"__basic":475},"findIndex":{"__basic":289},"forEach":{"__basic":276},"from":{"__detail":825,"__basic":279},"index":{"__basic":317},"indexOf":{"__basic":288},"isArray":{"__basic":282},"join":{"__basic":189},"keys":{"__basic":199},"lastIndexOf":{"__basic":317},"length":{"__basic":252},"map":{"__basic":429},"of":{"__basic":183},"pop":{"__basic":179},"push":{"__basic":208},"reduce":{"__basic":614},"reduceRight":{"__basic":644},"reverse":{"__basic":137},"shift":{"__basic":184},"slice":{"__basic":315},"some":{"__basic":312},"sort":{"__basic":391},"splice":{"__basic":873},"unshift":{"__basic":176},"values":{"__basic":234}}},"chalk":{"bgBlack":{"__basic":264},"bgBlue":{"__basic":259},"bgCyan":{"__basic":259},"bgGreen":{"__basic":264},"bgMagenta":{"__basic":274},"bgRed":{"__basic":254},"bgWhite":{"__basic":264},"bgYellow":{"__basic":269},"black":{"__basic":233},"blue":{"__basic":298},"bold":{"__basic":244},"dim":{"__basic":239},"enabled":{"__basic":353},"gray":{"__basic":228},"green":{"__basic":233},"hasColor":{"__basic":177},"hidden":{"__basic":205},"index":{"__basic":713},"inverse":{"__basic":237},"italic":{"__basic":280},"magenta":{"__basic":243},"red":{"__basic":223},"reset":{"__basic":254},"strikethrough":{"__basic":314},"stripColor":{"__basic":340},"styles":{"__basic":404},"supportsColor":{"__basic":361},"underline":{"__basic":260},"white":{"__basic":233},"yellow":{"__basic":238}}} \ No newline at end of file +{"vorpal":{"delimiter":{"__basic":239},"exec":{"__basic":566},"find":{"__basic":293},"index":{"__install":32,"__basic":658},"pipe":{"__basic":316},"show":{"__detail":1180,"__basic":143},"use":{"__basic":366},"session":{"delimiter":{"__basic":302},"index":{"__basic":255},"log":{"__basic":311},"prompt":{"__basic":629}},"on":{"client_command_error":{"__basic":79},"client_command_executed":{"__basic":82},"client_keypress":{"__basic":74},"client_prompt_submit":{"__basic":72},"command_registered":{"__basic":77},"index":{"__basic":592}},"mode":{"action":{"__basic":753},"delimiter":{"__basic":389},"index":{"__basic":477},"init":{"__detail":1176,"__basic":566}},"command":{"alias":{"__basic":209},"autocompletion":{"__detail":1623,"__basic":501},"description":{"__basic":221},"hidden":{"__basic":210},"index":{"__basic":467},"option":{"__basic":633},"remove":{"__basic":233},"action":{"index":{"__basic":177}}}},"vantage":{"auth":{"__detail":2836,"__basic":331},"banner":{"__basic":650},"index":{"__install":36,"__basic":1021},"listen":{"__detail":2488,"__basic":421},"on":{"client_command_error":{"__basic":80},"client_command_executed":{"__basic":83},"client_connect":{"__basic":67},"client_connect_error":{"__basic":73},"client_disconnect":{"__basic":70},"client_error":{"__basic":65},"client_keypress":{"__basic":75},"client_prompt_submit":{"__basic":73},"command_registered":{"__basic":78},"index":{"__basic":1089},"server_command_received":{"__basic":76},"server_connection":{"__basic":70},"server_disconnect":{"__basic":70}},"firewall":{"accept":{"__basic":349},"index":{"__basic":407},"policy":{"__basic":360},"reject":{"__basic":344}}},"robotjs":{"getMousePos":{"__basic":125},"getPixelColor":{"__basic":145},"getScreenSize":{"__basic":148},"index":{"__install":409,"__basic":261},"keyTap":{"__basic":292},"keyToggle":{"__basic":456},"mouseClick":{"__detail":187,"__basic":187},"mouseToggle":{"__basic":322},"moveMouse":{"__basic":180},"moveMouseSmooth":{"__basic":201},"setKeyboardDelay":{"__basic":132},"setMouseDelay":{"__basic":116},"typeString":{"__basic":147}},"pageres":{"dest":{"__basic":253},"index":{"__detail":2439,"__install":40,"__basic":604},"on":{"__basic":252},"run":{"__basic":220},"src":{"__detail":799,"__basic":259},"options":{"cookies":{"__basic":372},"crop":{"__basic":203},"delay":{"__basic":284},"filename":{"__basic":744},"format":{"__basic":241},"headers":{"__basic":218},"hide":{"__basic":235},"password":{"__basic":237},"scale":{"__basic":204},"selector":{"__basic":232},"userAgent":{"__basic":252},"username":{"__basic":233}}},"js":{"json":{"stringify":{"__basic":363}},"array":{"concat":{"__basic":330},"entries":{"__basic":251},"every":{"__basic":259},"fill":{"__basic":183},"filter":{"__basic":475},"findIndex":{"__basic":289},"forEach":{"__basic":276},"from":{"__detail":825,"__basic":279},"index":{"__basic":317},"indexOf":{"__basic":288},"isArray":{"__basic":282},"join":{"__basic":189},"keys":{"__basic":199},"lastIndexOf":{"__basic":317},"length":{"__basic":252},"map":{"__basic":429},"of":{"__basic":183},"pop":{"__basic":179},"push":{"__basic":208},"reduce":{"__basic":614},"reduceRight":{"__basic":644},"reverse":{"__basic":137},"shift":{"__basic":184},"slice":{"__basic":315},"some":{"__basic":312},"sort":{"__basic":391},"splice":{"__basic":873},"unshift":{"__basic":176},"values":{"__basic":234}}},"chalk":{"bgBlack":{"__basic":264},"bgBlue":{"__basic":259},"bgCyan":{"__basic":259},"bgGreen":{"__basic":264},"bgMagenta":{"__basic":274},"bgRed":{"__basic":254},"bgWhite":{"__basic":264},"bgYellow":{"__basic":269},"black":{"__basic":233},"blue":{"__basic":298},"bold":{"__basic":244},"dim":{"__basic":239},"enabled":{"__basic":353},"gray":{"__basic":228},"green":{"__basic":233},"hasColor":{"__basic":177},"hidden":{"__basic":205},"index":{"__basic":713},"inverse":{"__basic":237},"italic":{"__basic":280},"magenta":{"__basic":243},"red":{"__basic":223},"reset":{"__basic":254},"strikethrough":{"__basic":314},"stripColor":{"__basic":340},"styles":{"__basic":404},"supportsColor":{"__basic":361},"underline":{"__basic":260},"white":{"__basic":233},"yellow":{"__basic":238}}} \ No newline at end of file diff --git a/docs/pageres/dest.md b/docs/pageres/dest.md new file mode 100755 index 0000000..5a83009 --- /dev/null +++ b/docs/pageres/dest.md @@ -0,0 +1,10 @@ +## .dest(directory) + +Set the destination directory. + +```js +var pageres = new Pageres({delay: 2}) + .src('yeoman.io', ['480x320', '1024x768', 'iphone 5s'], {crop: true}) + .src('todomvc.com', ['1280x1024', '1920x1080']) + .dest(__dirname); +``` diff --git a/docs/pageres/index.detail.md b/docs/pageres/index.detail.md new file mode 100755 index 0000000..e120b21 --- /dev/null +++ b/docs/pageres/index.detail.md @@ -0,0 +1,111 @@ +## Pageres([options]) + +Capture screenshots of websites in various resolutions. A good way to make sure your websites are responsive. It's speedy and generates 100 screenshots from 10 different websites in just over a minute. It can also be used to render SVG images. + +```js +var Pageres = require('pageres'); + +var pageres = new Pageres({delay: 2}) + .src('yeoman.io', ['480x320', '1024x768', 'iphone 5s'], {crop: true}) + .src('todomvc.com', ['1280x1024', '1920x1080']) + .dest(__dirname); + +pageres.run(function (err) { + console.log('done'); +}); +``` +#### options + +##### delay + +Type: `number` *(seconds)* +Default: `0` + +Delay capturing the screenshot. + +Useful when the site does things after load that you want to capture. + +##### crop + +Type: `boolean` +Default: `false` + +Crop to the set height. + +##### cookies + +Type: `array` of `string`, `object` + +A string with the same format as a [browser cookie](http://en.wikipedia.org/wiki/HTTP_cookie) or an object of what [`phantomjs.addCookie`](http://phantomjs.org/api/phantom/method/add-cookie.html) accepts. + +###### Tip + +Go to the website you want a cookie for and copy-paste it from Dev Tools. + +##### filename + +Type: `string` + +Define a customized filename using [Lo-Dash templates](http://lodash.com/docs#template). +For example `<%= date %> - <%= url %>-<%= size %><%= crop %>`. + +Available variables: + +- `url`: The URL in [slugified](https://github.com/ogt/slugify-url) form, eg. `http://yeoman.io/blog/` becomes `yeoman.io!blog` +- `size`: Specified size, eg. `1024x1000` +- `width`: Width of the specified size, eg. `1024` +- `height`: Height of the specified size, eg. `1000` +- `crop`: Outputs `-cropped` when the crop option is true +- `date`: The current date (Y-M-d), eg. 2015-05-18 +- `time`: The current time (h-m-s), eg. 21-15-11 + +##### selector + +Type: `string` + +Capture a specific DOM element. + +##### hide + +Type: `array` + +Hide an array of DOM elements. + +##### username + +Type: `string` + +Username for authenticating with HTTP auth. + +##### password + +Type: `string` + +Password for authenticating with HTTP auth. + +##### scale + +Type: `number` +Default: `1` + +Scale webpage `n` times. + +##### format + +Type: `string` +Default: `png` +Values: `png`, `jpg` + +Image format. + +##### userAgent + +Type: `string` + +Custom user agent. + +##### headers + +Type: `object` + +Custom HTTP request headers. \ No newline at end of file diff --git a/docs/pageres/index.install.md b/docs/pageres/index.install.md new file mode 100755 index 0000000..dd63f73 --- /dev/null +++ b/docs/pageres/index.install.md @@ -0,0 +1,3 @@ +```text +npm install --save pageres +``` \ No newline at end of file diff --git a/docs/pageres/index.md b/docs/pageres/index.md new file mode 100755 index 0000000..1f41f36 --- /dev/null +++ b/docs/pageres/index.md @@ -0,0 +1,18 @@ +## pageres + +Capture screenshots of websites in various resolutions. A good way to make sure your websites are responsive. It's speedy and generates 100 screenshots from 10 different websites in just over a minute. It can also be used to render SVG images. + +Visit pageres-cli for the command-line version. + +```js +var Pageres = require('pageres'); + +var pageres = new Pageres({delay: 2}) + .src('yeoman.io', ['480x320', '1024x768', 'iphone 5s'], {crop: true}) + .src('todomvc.com', ['1280x1024', '1920x1080']) + .dest(__dirname); + +pageres.run(function (err) { + console.log('done'); +}); +``` \ No newline at end of file diff --git a/docs/pageres/on.md b/docs/pageres/on.md new file mode 100755 index 0000000..a18ee1a --- /dev/null +++ b/docs/pageres/on.md @@ -0,0 +1,11 @@ +## .on('warn', callback) + +Warning, for example with page errors. + +```js +// If you don't set a `.dest()` you'll get `items` in this callback, +// which is an array of streams. +pageres.on('warn', function (data) { + console.log(data); +}); +``` diff --git a/docs/pageres/options/cookies.md b/docs/pageres/options/cookies.md new file mode 100755 index 0000000..4edea07 --- /dev/null +++ b/docs/pageres/options/cookies.md @@ -0,0 +1,11 @@ +## Pageres({ cookies: string }) + +A string with the same format as a browser cookie or an object of what `phantomjs.addCookie` accepts. + +```js +var pageres = new Pageres({cookies: cookie}) + .src('yeoman.io', ['480x320', '1024x768', 'iphone 5s'], {crop: true}) + .dest(__dirname); +``` + +Tip: Go to the website you want a cookie for and copy-paste it from Dev Tools. \ No newline at end of file diff --git a/docs/pageres/options/crop.md b/docs/pageres/options/crop.md new file mode 100755 index 0000000..1c0dd4f --- /dev/null +++ b/docs/pageres/options/crop.md @@ -0,0 +1,9 @@ +## Pageres({ crop: number }) + +Crop to the set height. + +```js +var pageres = new Pageres({crop: 768}) + .src('yeoman.io', ['480x320', '1024x768', 'iphone 5s'], {crop: true}) + .dest(__dirname); +``` \ No newline at end of file diff --git a/docs/pageres/options/delay.md b/docs/pageres/options/delay.md new file mode 100755 index 0000000..f5f587c --- /dev/null +++ b/docs/pageres/options/delay.md @@ -0,0 +1,11 @@ +## Pageres({ delay: number }) + +Delay capturing the screenshot. + +Useful when the site does things after load that you want to capture. + +```js +var pageres = new Pageres({delay: 2}) + .src('yeoman.io', ['480x320', '1024x768', 'iphone 5s'], {crop: true}) + .dest(__dirname); +``` \ No newline at end of file diff --git a/docs/pageres/options/filename.md b/docs/pageres/options/filename.md new file mode 100755 index 0000000..7c00c9b --- /dev/null +++ b/docs/pageres/options/filename.md @@ -0,0 +1,21 @@ +## Pageres({ filename: string }) + +Define a customized filename using Lo-Dash templates. + +For example `<%= date %> - <%= url %>-<%= size %><%= crop %>`. + +Available variables: + +- `url`: The URL in slugified form, eg. `http://yeoman.io/blog/` becomes `yeoman.io!blog` +- `size`: Specified size, eg. `1024x1000` +- `width`: Width of the specified size, eg. `1024` +- `height`: Height of the specified size, eg. `1000` +- `crop`: Outputs `-cropped` when the crop option is true +- `date`: The current date (Y-M-d), eg. 2015-05-18 +- `time`: The current time (h-m-s), eg. 21-15-11 + +```js +var pageres = new Pageres({filename: '<%= date %>'}) + .src('yeoman.io', ['480x320', '1024x768', 'iphone 5s'], {crop: true}) + .dest(__dirname); +``` \ No newline at end of file diff --git a/docs/pageres/options/format.md b/docs/pageres/options/format.md new file mode 100755 index 0000000..da1ca6b --- /dev/null +++ b/docs/pageres/options/format.md @@ -0,0 +1,12 @@ +## Pageres({ format: string }) + +Image format. + +Default: `png` +Values: `png`, `jpg` + +```js +var pageres = new Pageres({format: 'jpg'}) + .src('yeoman.io', ['480x320', '1024x768', 'iphone 5s'], {crop: true}) + .dest(__dirname); +``` \ No newline at end of file diff --git a/docs/pageres/options/headers.md b/docs/pageres/options/headers.md new file mode 100755 index 0000000..58306db --- /dev/null +++ b/docs/pageres/options/headers.md @@ -0,0 +1,9 @@ +## Pageres({ headers: string }) + +Custom HTTP request headers. + +```js +var pageres = new Pageres({headers: headers}) + .src('yeoman.io', ['480x320', '1024x768', 'iphone 5s'], {crop: true}) + .dest(__dirname); +``` \ No newline at end of file diff --git a/docs/pageres/options/hide.md b/docs/pageres/options/hide.md new file mode 100755 index 0000000..87d5de5 --- /dev/null +++ b/docs/pageres/options/hide.md @@ -0,0 +1,9 @@ +## Pageres({ hide: array }) + +Hide an array of DOM elements. + +```js +var pageres = new Pageres({hide: ['.unicorn-badge', '.button']}) + .src('yeoman.io', ['480x320', '1024x768', 'iphone 5s'], {crop: true}) + .dest(__dirname); +``` \ No newline at end of file diff --git a/docs/pageres/options/password.md b/docs/pageres/options/password.md new file mode 100755 index 0000000..4b90887 --- /dev/null +++ b/docs/pageres/options/password.md @@ -0,0 +1,9 @@ +## Pageres({ password: string }) + +Password for authenticating with HTTP auth. + +```js +var pageres = new Pageres({password: 'ABC123!'}) + .src('yeoman.io', ['480x320', '1024x768', 'iphone 5s'], {crop: true}) + .dest(__dirname); +``` \ No newline at end of file diff --git a/docs/pageres/options/scale.md b/docs/pageres/options/scale.md new file mode 100755 index 0000000..bf460b1 --- /dev/null +++ b/docs/pageres/options/scale.md @@ -0,0 +1,9 @@ +## Pageres({ scale: number }) + +Scale webpage `n` times. + +```js +var pageres = new Pageres({scale: 2}) + .src('yeoman.io', ['480x320', '1024x768', 'iphone 5s'], {crop: true}) + .dest(__dirname); +``` \ No newline at end of file diff --git a/docs/pageres/options/selector.md b/docs/pageres/options/selector.md new file mode 100755 index 0000000..42d6f14 --- /dev/null +++ b/docs/pageres/options/selector.md @@ -0,0 +1,9 @@ +## Pageres({ selector: string }) + +Capture a specific DOM element. + +```js +var pageres = new Pageres({selector: '.unicorn-badge'}) + .src('yeoman.io', ['480x320', '1024x768', 'iphone 5s'], {crop: true}) + .dest(__dirname); +``` \ No newline at end of file diff --git a/docs/pageres/options/userAgent.md b/docs/pageres/options/userAgent.md new file mode 100755 index 0000000..77a0f12 --- /dev/null +++ b/docs/pageres/options/userAgent.md @@ -0,0 +1,12 @@ +## Pageres({ userAgent: string }) + +Custom user agent. + +Default: `png` +Values: `png`, `jpg` + +```js +var pageres = new Pageres({userAgent: agent}) + .src('yeoman.io', ['480x320', '1024x768', 'iphone 5s'], {crop: true}) + .dest(__dirname); +``` \ No newline at end of file diff --git a/docs/pageres/options/username.md b/docs/pageres/options/username.md new file mode 100755 index 0000000..29d20a9 --- /dev/null +++ b/docs/pageres/options/username.md @@ -0,0 +1,9 @@ +## Pageres({ username: string }) + +Username for authenticating with HTTP auth. + +```js +var pageres = new Pageres({username: 'joe'}) + .src('yeoman.io', ['480x320', '1024x768', 'iphone 5s'], {crop: true}) + .dest(__dirname); +``` \ No newline at end of file diff --git a/docs/pageres/run.md b/docs/pageres/run.md new file mode 100755 index 0000000..31d02f8 --- /dev/null +++ b/docs/pageres/run.md @@ -0,0 +1,11 @@ +## .run(callback) + +Run pageres. + +```js +// If you don't set a `.dest()` you'll get `items` in this callback, +// which is an array of streams. +pageres.run(function (err, items) { + console.log('done'); +}); +``` diff --git a/docs/pageres/src.detail.md b/docs/pageres/src.detail.md new file mode 100755 index 0000000..874ca87 --- /dev/null +++ b/docs/pageres/src.detail.md @@ -0,0 +1,33 @@ +## .src(url, sizes[, options]) + +Add a page to a screenshot. + +```js +var pageres = new Pageres({delay: 2}) + .src('yeoman.io', ['480x320', '1024x768', 'iphone 5s'], {crop: true}) + .src('todomvc.com', ['1280x1024', '1920x1080']) + .dest(__dirname); +``` +#### url + +*Required* +Type: `string` + +URL or local path to the website you want to screenshot. + +#### sizes + +*Required* +Type: `array` + +Use a `x` notation or a keyword. + +A keyword is a version of a device from [this list](http://viewportsizes.com). +You can also pass in the `w3counter` keyword to use the ten most popular +resolutions from [w3counter](http://www.w3counter.com/globalstats.php). + +#### options + +Type: `object` + +Options set here will take precedence over the ones set in the constructor. \ No newline at end of file diff --git a/docs/pageres/src.md b/docs/pageres/src.md new file mode 100755 index 0000000..4ab73b8 --- /dev/null +++ b/docs/pageres/src.md @@ -0,0 +1,10 @@ +## .src(url, sizes[, options]) + +Add a page to a screenshot. + +```js +var pageres = new Pageres({delay: 2}) + .src('yeoman.io', ['480x320', '1024x768', 'iphone 5s'], {crop: true}) + .src('todomvc.com', ['1280x1024', '1920x1080']) + .dest(__dirname); +``` \ No newline at end of file