bfn-grunt-webshot
v1.1.1
Published
Render screenshots of webpages and local html
Downloads
3
Maintainers
Readme
bfn-grunt-webshot
Grunt plugin to run webshot and take screenshots of webpages and local html.
A simple (naïve) wrapper for webshot that uses phantomJS to render webpages to various image formats.
For example generate preview images of your project to send to clients, update screenshots for your documentation or get creative with the browser rendering engine. Use webshot features like offsets, timers and a 'trigger' callback for interesting setups.
Getting Started
This plugin requires Grunt ~0.4.1
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
$ npm install grunt-webshot --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-webshot');
The "webshot" task
Options
The grunt-webshot
specific options are:
- Required
site
andsavePath
are used as arguments to call the webshot method.
All other options are passed directly to webshot: see the documentation for a list of supported options.
grunt.initConfig({
webshot: {
// example
homepage: {
options: {
// url, file or html
siteType: 'url',
site: 'https://github.com/BlueFidelity/grunt-webshot',
savePath: './tmp/shot.png',
windowSize: {
width: 1024,
height: 768
},
shotSize: {
width: 1024,
height: 'all'
}
}
}
}
});