https://github.com/unic/estatico-html-validate
https://github.com/unic/estatico-html-validate
Last synced: 22 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/unic/estatico-html-validate
- Owner: unic
- Created: 2017-05-18T17:24:07.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-11-28T14:42:51.000Z (over 8 years ago)
- Last Synced: 2026-01-15T17:11:21.101Z (5 months ago)
- Language: JavaScript
- Size: 55.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# estatico-html-validate
Sends HTML pages through the [w3c validator](https://validator.w3.org/).
## Installation
```
$ npm i -S estatico-html-validate
```
## Usage
```js
const gulp = require('gulp');
const validateTask = require('estatico-html-validate');
const validateOptions = {}; // Custom options, deep-merged into defaults via _.merge
gulp.task('html:validate', () => validateTask(validateOptions));
```
### Options
#### src
Type: `Array` or `String`
Default:
```js
[
'./dist/*.html',
'./dist/modules/**/*.html',
'./dist/pages/**/*.html',
]
```
Passed to `gulp.src`.
#### srcBase
Type: `String`
Default: `'./dist'`
Passed as `base` option to `gulp.src`.
#### watch
Type: `Array`/`String`
Default:
```js
[
'./dist/*.html',
'./dist/modules/**/*.html',
'./dist/pages/**/*.html',
]
```
Used in separate watch task, changes to above files will trigger the task.
#### errorHandler
Type: `Function`
Default:
```js
(err) => {
log(`estatico-html-validate${err.plugin ? ` (${err.plugin})` : null}`, chalk.cyan(err.fileName), chalk.red(err.message));
}
```
Function to run if an error occurs in one of the steps.
#### plugins
Type: `Object`
##### plugins.w3cjs
Type: `Object`
Default:
```js
{}
```
Passed to [`gulp-w3cjs`](https://www.npmjs.com/package/gulp-w3cjs).
## License
Apache 2.0.