<commit_before># grunt-webshot

> Grunt [plugin](http://gruntjs.com/) to run [webshot](https://github.com/brenden/node-webshot/) and take screenshots of websites and local html.

[![Build Status](https://secure.travis-ci.org/Bartvds/grunt-webshot.png?branch=master)](http://travis-ci.org/Bartvds/grunt-webshot) [![Dependency Status](https://gemnasium.com/Bartvds/grunt-webshot.png)](https://gemnasium.com/Bartvds/grunt-webshot) [![NPM version](https://badge.fury.io/js/grunt-webshot.png)](http://badge.fury.io/js/grunt-webshot)

A simple (naïve) wrapper for [webshot](https://github.com/brenden/node-webshot/) that uses phantomJS to render webpages to various image formats.

For example generate preview images of your project to send to clients, link in the documentation or get creative with the browser rendering engine: webshot has some interesting features like offsets, timers and a 'trigger' callback.

## Getting Started

This plugin requires Grunt `~0.4.1`

If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

```shell
$ npm install grunt-webshot --save-dev
```

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

```js
grunt.loadNpmTasks('grunt-webshot');
```

## The "webshot" task       

### Options

Most options are passed directly tot the screenshot command: [webshot](https://github.com/brenden/node-webshot/) for supported options.

The `grunt-webshot` specific options are:

Required `site` and `savePath` are passed to screenshot method.

Additional the `siteType` option supports a new property `'file'` that will treat the behaviour of the `'site'` options as the file path to read as html. 

```js
grunt.initConfig({
	webshot: {
		// example
		homepage: {<commit_msg>text edits<commit_after># grunt-webshot

> Grunt [plugin](http://gruntjs.com/) to run [webshot](https://github.com/brenden/node-webshot/) and take screenshots of websites and local html.

[![Build Status](https://secure.travis-ci.org/Bartvds/grunt-webshot.png?branch=master)](http://travis-ci.org/Bartvds/grunt-webshot) [![Dependency Status](https://gemnasium.com/Bartvds/grunt-webshot.png)](https://gemnasium.com/Bartvds/grunt-webshot) [![NPM version](https://badge.fury.io/js/grunt-webshot.png)](http://badge.fury.io/js/grunt-webshot)

A simple (naïve) wrapper for [webshot](https://github.com/brenden/node-webshot/) that uses phantomJS to render webpages to various image formats.

For example generate preview images of your project to send to clients, link in the documentation or get creative with the browser rendering engine. Use webshot features like offsets, timers and a 'trigger' callback.

## Getting Started

This plugin requires Grunt `~0.4.1`

If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

```shell
$ npm install grunt-webshot --save-dev
```

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

```js
grunt.loadNpmTasks('grunt-webshot');
```

## The "webshot" task       

### Options

The `grunt-webshot` specific options are:

* Required `site` and `savePath` are passed to screenshot method.
* Additional the `siteType` option supports a new property `'file'` that will treat the behaviour of the `'site'` options as the file path to read as html. 


All other options are passed directly to the webshot screenshot command: see [the  documentation](https://github.com/brenden/node-webshot/) for supported options.

```js
grunt.initConfig({
	webshot: {
		// example
		homepage: {
{'fraction_non_alphanumeric': 0.12223033844655466, 'fraction_numerical': 0.0014609203798392988, 'mean_word_length': 4.737430167597766, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 14, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7160565', 'n_tokens_mistral': 1305, 'n_tokens_neox': 1262, 'n_words': 427}