Home | Articles | CV (pdf | short)
<2009-01-30> by Lorenzo

Command line HTML validator

Valid HTML is something we should strive to achieve. W3C Validator is an invaluable tool to do just that. Unfortunately, validating a local file you are working on can be annoying after the 100th time you've uploaded it to the W3C website.

Here you can find a command line HTML validator that simply uploads anything passed to it from stdin to the W3C Validator. The basic syntax is:

$> python validate.py < file_to_validate.html

It requires html2text to print the detailed list of errors.

Enjoy!