From 7f1df74612d6e7d7484f87c334c75949d59149d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D1=83=D1=82=D1=87=D0=B5=D0=BD=D0=BA=D0=BE=20=D0=9E?= =?UTF-8?q?=D0=BB=D0=B5=D0=B3?= Date: Sat, 16 Nov 2019 16:13:26 +0200 Subject: [PATCH] 1.6.0 - Errors and Warnings suppressing --- README.md | 71 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 44 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 09eb5fa..603e702 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,22 @@ > Visit https://java.com for download Java if you not have it +--- + +## Table of Contents + +1. [CLI](https://github.com/dutchenkoOleg/node-w3c-validator#cli) + - [Options](https://github.com/dutchenkoOleg/node-w3c-validator#options) +1. [Node.js API](https://github.com/dutchenkoOleg/node-w3c-validator#nodejs-api) + - [nodeW3CValidator()](https://github.com/dutchenkoOleg/node-w3c-validator#nodew3cvalidatorpathto-options-done) + - [nodeW3CValidator.writeFile()](https://github.com/dutchenkoOleg/node-w3c-validator#nodew3cvalidatorwritefilefilepath-outputdata-done) + - [Usage Example](https://github.com/dutchenkoOleg/node-w3c-validator#usage-example) +1. [Errors and Warnings suppressing](https://github.com/dutchenkoOleg/node-w3c-validator#errors-and-warnings-suppressing) +1. [Changelog](https://github.com/dutchenkoOleg/node-w3c-validator#changelog) +1. [Contributing](https://github.com/dutchenkoOleg/node-w3c-validator#contributing) + - [Contributors 💪](https://github.com/dutchenkoOleg/node-w3c-validator#contributors-) +1. [Code of Conduct](https://github.com/dutchenkoOleg/node-w3c-validator#code-of-conduct) + --- ## CLI @@ -229,8 +245,35 @@ Name | Data type | Argument | Description `outputData` | `string / Buffer` | | file output content `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) +### Usage Example + +```js +// imports +const nodeW3CValidator = require('node-w3c-validator'); + +// paths +const validatePath = './dist/*.html'; +// or directly to the file - './dist/index.html' +// or a glob pattern - './dist/**/*.html' +const resultOutput = './reports/result.html'; + +// validate +nodeW3CValidator(validatePath, { + format: 'html', + skipNonHtml: true, + verbose: true +}, function (err, output) { + if (err === null) { + return; + } + nodeW3CValidator.writeFile(resultOutput, output); +}); +``` + +--- + -### Errors and Warnings suppressing +## Errors and Warnings suppressing You can ignore some errors or warnings by suppressing them. _**Note!** This feature can be used only on `html`, `json` and `lint` formats._ @@ -261,32 +304,6 @@ Now you can suppress it } ``` - -### Usage Example - -```js -// imports -const nodeW3CValidator = require('node-w3c-validator'); - -// paths -const validatePath = './dist/*.html'; -// or directly to the file - './dist/index.html' -// or a glob pattern - './dist/**/*.html' -const resultOutput = './reports/result.html'; - -// validate -nodeW3CValidator(validatePath, { - format: 'html', - skipNonHtml: true, - verbose: true -}, function (err, output) { - if (err === null) { - return; - } - nodeW3CValidator.writeFile(resultOutput, output); -}); -``` - --- ## Changelog