The Nu Html Checker (v.Nu) is the backend of checker.html5.org, html5.validator.nu, and validator.w3.org/nu. Its source code is available, as are instructions on how to build, test, and run the code.
vnu.jar is a packaged version of the Nu Html Checker for batch-checking
documents from the command line and from other scripts/apps.
You can work with vnu.jar in CommonJS modules.
$ npm install --save vnu-jar$ npm install --save vnu-jar@devFor Node.js 6+
'use strict'; const exec = exec;const vnu = ; // Print path to vnu.jar console; // Work with vnu.jar // for example get vnu.jar version ; Use the vnu.jar HTML checker as an executable for command-line checking of
documents by invoking it like this:
java -jar ~/vnu.jar [--errors-only] [--exit-zero-always]
[--asciiquotes] [--no-stream] [--format gnu|xml|json|text] [--html]
[--skip-non-html] [--no-langdetect] [--help] [--verbose] [--version]
FILES
Note: In these instructions, replace "~/vnu.jar" with the actual path to the file on your system.
To check one or more documents from the command line:
java -jar ~/vnu.jar FILE.html FILE2.html FILE3.HTML FILE4.html...
Note: If you get a StackOverflowError error when using the vnu.jar file,
try adjusting the thread stack size by providing the -Xss option to java:
java -Xss512k -jar ~/vnu.jar FILE.html...
To check all documents in a particular directory:
java -jar ~/vnu.jar some-directory-name/
To check all documents in a particular directory, skipping any documents whose
names don’t end with the extensions .html, .htm, .xhtml, or .xht:
java -jar ~/vnu.jar --skip-non-html some-directory-name/
To check a Web document:
java -jar ~/vnu.jar _URL_
example: java -jar ~/vnu.jar http://example.com/foo
To check standard input:
java -jar ~/vnu.jar -
example: echo '<!doctype html><title>...' | java -jar ~/vnu.jar -
When used from the command line as described in this section, the vnu.jar
executable provides the following options:
Specifies whether ASCII quotation marks are substituted for Unicode smart
quotation marks in messages.
default: "no"
possible values: "yes" or "no"
Specifies that only error-level messages and non-document-error messages are
reported (so that warnings and info messages are not reported).
default: [unset; all message reported, including warnings & info messages]
Makes the checker exit zero even if errors are reported for any documents.
default: [unset; checker exits 1 if errors are reported for any documents]
Specifies the output format for reporting the results.
default: "gnu"
possible values: "gnu", "xml", "json", "text" [see information at URL below]
https://github.com/validator/validator/wiki/Service-%C2%BB-Common-params#out
Shows detailed usage information.
Skip documents that don’t have *.html, *.htm, *.xhtml, or *.xht extensions.
default: [unset; all documents found are checked, regardless of extension]
Forces any *.xhtml or *.xht documents to be parsed using the HTML parser.
default: [unset; XML parser is used for *.xhtml and *.xht documents]
Disables language detection, so that documents are not checked for missing
or mislabeled html[lang] attributes.
default: [unset; language detection & html[lang] checking are performed]
Forces all documents to be be parsed in buffered mode instead of streaming
mode (causes some parse errors to be treated as non-fatal document errors
instead of as fatal document errors).
default: [unset; non-streamable parse errors cause fatal document errors]
Specifies "verbose" output. (Currently this just means that the names of
files being checked are written to stdout.)
default: [unset; output is not verbose]
Shows the vnu.jar version number.