npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

metalsmith-formatcheck

v0.2.5

Published

Metalsmith plugin for HTML5 format checking

Downloads

11

Readme

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.