0.2.5 • Published 6 years ago

metalsmith-formatcheck v0.2.5

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

metalsmith-formatcheck

This is a plugin for Metalsmith that checks HTML pages for HTML5 format compliance via the html-validator module.

Installation

This module is released via npm, install the latest released version with:

npm install --save metalsmith-formatcheck

Usage

If using the CLI for Metalsmith, metalsmith-formatcheck can be used like any other plugin by including it in metalsmith.json:

{
  "plugins": {
    "metalsmith-formatcheck"
  }
}

For Metalsmith's JavaScript API, metalsmith-formatcheck can be used like any other plugin, by attaching it to the function invocation chain on the metalscript object:

var formatcheck = require('metalsmith-formatcheck');
require('metalsmith')(__dirname)
  .use(formatcheck())
  .build();

Because metalsmith-formatcheck will only check HTML pages, normally you will want to use metalsmith-formatcheck at the end of your build pipeline when all of your HTML pages have been generated. Note that metalsmith-formatcheck requires network access.

Options

metalsmith-formatcheck does not require any options, but the following options are available:

verbose (optional)

(default: false)

If set a message will be printed if files generate warnings or errors.

checkedPart (optional)

(default: *)

jQuery filter identifying the part of the HTML document to check. Useful to ignore headers and footers that might contain irrelevant changes.

failWithoutNetwork (optional)

(default : true)

If set, metalsmith-formatcheck will fail if no network connection is available.

failErrors (optional)

(default: true)

If set the metalsmith build process will halt if any files have format errors.

failWarnings (optional)

(default: false)

If set the metalsmith build process will halt if any files have format warnings.

cacheChecks (optional)

(default: true)

If set metalsmith-formatcheck will record when external links succeed in checkFile and not repeat the check for an interval set by recheckMinutes.

checkFile (optional)

(default: .format_checked.json)

Path relative to the metalsmith source directory where metalsmith-formatcheck caches link check information. This will be removed from the build directory.

failFile (optional)

(default: format_failed.json)

Path relative to the metalsmith source directory to a JSON file where link failures are recorded. This will be removed from the build directory.

Ignoring Files

Any files with checkFormat set to false will be ignored.

0.2.5

6 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.6

9 years ago

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago