source: Dev/trunk/node_modules/grunt-htmlhint/README.md @ 507

Last change on this file since 507 was 484, checked in by hendrikvanantwerpen, 11 years ago

Commit node_modules, to make checkouts and builds more deterministic.

File size: 2.0 KB
Line 
1# grunt-htmlhint
2
3> Validate html files with htmlhint.
4
5## Getting Started
6This plugin requires Grunt `~0.4.1`
7
8If 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:
9
10```shell
11npm install grunt-htmlhint --save-dev
12```
13
14One the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
15
16```js
17grunt.loadNpmTasks('grunt-htmlhint');
18```
19
20## The "htmlhint" task
21
22### Overview
23In your project's Gruntfile, add a section named `htmlhint` to the data object passed into `grunt.initConfig()`.
24
25### Options
26
27See all rules here: [https://github.com/yaniswang/HTMLHint/wiki/Rules](https://github.com/yaniswang/HTMLHint/wiki/Rules)
28
29If options is empty, task will scan nothing.
30
31#### options.htmlhintrc
32Type: `String`
33Default value: `null`
34
35If this filename is specified, options and globals defined therein will be used. Task and target options override the options within the `htmlhintrc` file. The `htmlhintrc` file must be valid JSON and looks something like this:
36
37```json
38{
39  "tag-pair": true,
40}
41```
42
43#### options.force
44Type: `Boolean`
45Default value: `false`
46
47Report HTMLHint errors but dont fail the task
48
49### Usage Examples
50
51#### Direct options
52
53```js
54htmlhint: {
55  html1: {
56    options: {
57      'tag-pair': true
58    },
59    src: ['path/to/**/*.html']
60  },
61  html2: {
62    options: {
63      'tag-pair': true
64    },
65    src: ['path/to/**/*.html']
66  }
67}
68```
69
70#### Config file
71
72```js
73htmlhint: {
74  options: {
75    htmlhintrc: '.htmlhintrc'
76  },
77  html1: {
78    src: ['path/to/**/*.html']
79  },
80  html2: {
81    src: ['path/to/**/*.html']
82  }
83}
84```
85
86## Release History
87
88 * 2013-4-6   v0.4.0   First release
Note: See TracBrowser for help on using the repository browser.