Skip to content

Commit 7f1df74

Browse files
committed
1.6.0 - Errors and Warnings suppressing
1 parent 10b4eb4 commit 7f1df74

File tree

1 file changed

+44
-27
lines changed

1 file changed

+44
-27
lines changed

README.md

Lines changed: 44 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,22 @@
1717
> Visit https://java.com for download Java if you not have it
1818
1919

20+
---
21+
22+
## Table of Contents
23+
24+
1. [CLI](https://github.com/dutchenkoOleg/node-w3c-validator#cli)
25+
- [Options](https://github.com/dutchenkoOleg/node-w3c-validator#options)
26+
1. [Node.js API](https://github.com/dutchenkoOleg/node-w3c-validator#nodejs-api)
27+
- [nodeW3CValidator()](https://github.com/dutchenkoOleg/node-w3c-validator#nodew3cvalidatorpathto-options-done)
28+
- [nodeW3CValidator.writeFile()](https://github.com/dutchenkoOleg/node-w3c-validator#nodew3cvalidatorwritefilefilepath-outputdata-done)
29+
- [Usage Example](https://github.com/dutchenkoOleg/node-w3c-validator#usage-example)
30+
1. [Errors and Warnings suppressing](https://github.com/dutchenkoOleg/node-w3c-validator#errors-and-warnings-suppressing)
31+
1. [Changelog](https://github.com/dutchenkoOleg/node-w3c-validator#changelog)
32+
1. [Contributing](https://github.com/dutchenkoOleg/node-w3c-validator#contributing)
33+
- [Contributors 💪](https://github.com/dutchenkoOleg/node-w3c-validator#contributors-)
34+
1. [Code of Conduct](https://github.com/dutchenkoOleg/node-w3c-validator#code-of-conduct)
35+
2036
---
2137

2238
## CLI
@@ -229,8 +245,35 @@ Name | Data type | Argument | Description
229245
`outputData` | `string / Buffer` | | file output content
230246
`done` | `Function` | _optional_ | if exist - it will asynchronous writes output to the filePath. See [fs.writeFile(file, data, callback)](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback)
231247

248+
### Usage Example
249+
250+
```js
251+
// imports
252+
const nodeW3CValidator = require('node-w3c-validator');
253+
254+
// paths
255+
const validatePath = './dist/*.html';
256+
// or directly to the file - './dist/index.html'
257+
// or a glob pattern - './dist/**/*.html'
258+
const resultOutput = './reports/result.html';
259+
260+
// validate
261+
nodeW3CValidator(validatePath, {
262+
format: 'html',
263+
skipNonHtml: true,
264+
verbose: true
265+
}, function (err, output) {
266+
if (err === null) {
267+
return;
268+
}
269+
nodeW3CValidator.writeFile(resultOutput, output);
270+
});
271+
```
272+
273+
---
274+
232275

233-
### Errors and Warnings suppressing
276+
## Errors and Warnings suppressing
234277

235278
You can ignore some errors or warnings by suppressing them.
236279
_**Note!** This feature can be used only on `html`, `json` and `lint` formats._
@@ -261,32 +304,6 @@ Now you can suppress it
261304
}
262305
```
263306

264-
265-
### Usage Example
266-
267-
```js
268-
// imports
269-
const nodeW3CValidator = require('node-w3c-validator');
270-
271-
// paths
272-
const validatePath = './dist/*.html';
273-
// or directly to the file - './dist/index.html'
274-
// or a glob pattern - './dist/**/*.html'
275-
const resultOutput = './reports/result.html';
276-
277-
// validate
278-
nodeW3CValidator(validatePath, {
279-
format: 'html',
280-
skipNonHtml: true,
281-
verbose: true
282-
}, function (err, output) {
283-
if (err === null) {
284-
return;
285-
}
286-
nodeW3CValidator.writeFile(resultOutput, output);
287-
});
288-
```
289-
290307
---
291308

292309
## Changelog

0 commit comments

Comments
 (0)