MyNixOS website logo
Description

A command-line interface for https://validator.w3.org/

html-validator-cli CircleCI

Command Line Interface for The W3C Markup Validation Service

$ cat /var/www/html/index.html
<!DOCTYPE html>
<html>
    <body>Hello, Validator!</body>
</html>

$ validatehtml /var/www/html/index.html
[ERROR] The character encoding was not declared. Proceeding using “windows-1252”.

[ERROR] Element “head” is missing a required instance of child element “title”.
From line 2, column 7; to line 3, column 10
ml> <html>     <body>Hello,
          ^^^^^^^^^^^

[WARNING] Consider adding a “lang” attribute to the “html” start tag to declare the language of this document.
From line 1, column 16; to line 2, column 6
TYPE html> <html>     <
          ^^^^^^^

Installation

Prerequisites

Make sure you have a fresh version of Stack or Cabal installed.

Installation

stack update
stack install html-validator-cli

or

cabal update
cabal install html-validator-cli

Usage

Usage: validatehtml [-u URL] [-x DIR] FILE | DIR ...
  -s URL  --validator-url=URL  validation service url (default: https://validator.w3.org/nu/)
  -x DIR  --exclude=DIR        exclude files in DIR
  -1      --oneline            print each message on one line
  • FILE | DIR ...
    • Specify one or more HTML files to validate. When a directory is specified, all HTML files under that will be checked.
  • -s URL, --validator-url=URL
    • Specify the alternative validation service that uses The Nu Html Checker as its backend like follows:
      • https://checker.html5.org/
      • https://html5.validator.nu/
      • or your self-hosted The Nu Html Checker instance.
  • -x DIR, --exclude=DIR
    • Specify the folder name that you want to exclude from checking.
  • -1, --oneline
    • Specify it if you want to print the validation result in compact format.

License

Copyright (c) IIJ Innovation Institute Inc.

Licensed under The 3-Clause BSD License.

Metadata

Version

0.1.0.5

Executables (1)

  • bin/validatehtml

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows