-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
dthree
committed
Sep 1, 2015
1 parent
5c3d56b
commit 419654c
Showing
22 changed files
with
340 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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}}} | ||
{"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}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```text | ||
npm install --save pageres | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'); | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'); | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 `<width>x<height>` 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
``` |
419654c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sindresorhus ping :)
419654c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Though, is it really feasable to embed docs manually? Will be hard to keep it all up to date, right?
419654c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was thinking about that - I think it's doable if I get enough traction, i.e. enough people are using it. I'm trying to make it as easy as possible to contribute, so that people can fix things if they see it. I really want to center the docs around the community, making them community-built. Kind of the "Wikipedia" for libraries and repos.
Wikipedia wasn't supposed to work, but it did. This project could really go both directions, so I'm placing a bet on it. :)
I've still got a few more weeks before 1.0, as I need to make it ridiculously usable if it's going to be adopted.
419654c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sindresorhus is right, and I was giving it some thought earlier on. Now not only does pageres (or insert library here library) have to up-keep their own documentation, someone will have to take the time to update it here, too. While in theory a "lot of traction" would keep it in check, practicality states that it definitely will never happen like that.
Instead, why not use the projects' existing docs (creating new
wat-xyz
repos for things like built-in Javascript functionality, perhaps) and create an index that lives in the root of wat that has a key/value dictionary of names/repositories. In the event you want something from that name, you cangit clone
the repository down and just use the docs from it.Just a thought. It depends entirely on your ability to parse data, though. As well, it depends on whether or not the project is
wat
compatible. I could foresee projects making their docswat
compatible being a more feasible approach than to keep two copies of documentation up to date between two separate, unrelated repositories.419654c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even worse, the documentation here will get outdated and I as a project maintainer will have to handle support questions about
pageres
not working according to the outdatedwat
docs. Outdated documentation is worse than none, IMHO.Some resources to existing solutions to this:
wat
)This discussion should be moved into an issue.
419654c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got you. This is a very good point.
The thing that sucks about auto-generated doc sets, such as the Go doc set, is that it's so impersonal. It's the entire payload of that library. I really don't want
wat
to be some official documentation source as that's already covered, rather 20 lines or less usage snippits for people already familiar with a lib and just want syntax. So I have to figure out how to automatically design these "partial" docs that emphasize usage examples over full descriptions, if you see what I mean, and it should apply to more than Node.I was thinking of making a smart markdown to syntax parser that scaffolds out the docs, as READMEs are the closest thing to what I am trying to approximate with Wat: they're human-to-human. But that would obviously need to be pruned after generation as Qix said: there's no standard for markdown layout.
Wat will also have a command, btw, such as
github chalk
, which will pull the Chalk readme from Github and render it in the CLI., just as it currently supportsstackoverflow js splice an array
, using the Stack Exchange API.Perhaps I can also check updated dates on docs, and for older docs make a warning that
wat
is not an official doc source, and on discepancies refer to the repohere
kind of thing.@Qix- saw the issue you opened. For anything solely wat related on the discussion, we can use this as well:
#15