PDA

View Full Version : New Ubuntu package: command-line W3C HTML validator



mrclean
12 Dec 2009, 05:41 PM
Hi everybody

I made an Ubuntu package of www.pre-emptive.net's command-line version of the W3C's online Markup Validation Service (http://validator.w3.org/). Note that this is a fork of the W3C's validator, not the official W3C validator itself, which is a CGI script rather than a command-line program.

It's not part of the official Ubuntu distribution (and perhaps never will be), but you can install it from my PPA like so on Ubuntu karmic:

sudo add-apt-repository ppa:jjl/w3cvalidator
sudo apt-get install w3c-markup-validator-commandline

So far, I've only built a package for Ubuntu karmic (9.10). If there's demand I may rebuild it for earlier versions of Ubuntu, or for Debian proper.

To use, run:

w3c-validate my_page.html

There are also -mime and -encoding switches to specify those, though I'd say it's best to write your HTML so that you don't need to use those. The original documentation is linked to from this page:

http://www.pre-emptive.net/doco/w3cvalidator-command-line-html-validator

Notes:


I think www.pre-emptive.net's version is somewhat older than the most recent W3C release, so there will be a few differences from the official online version. The relevant (i.e. validation-related) differences appear to be fairly minor, looking at the changelog.
There are certainly a few bugs, though none I've seen so far affected validation correctness (instead, they related to handling of command line options). Please try to verify that bugs you find are related to the debian package before emailing me about them. If your bug is very likely present in the upstream www.pre-emptive.net code rather than in the debian packaging (e.g. Perl warnings about uninitialized values), please let them know about it, not me.
Similarly, if you find a problem with the debian package, please don't bother the www.pre-emptive.net people about it. Email me instead.
I don't promise to maintain this.
If anybody knows of something better, I'd be glad to hear of it, so that I can stop maintaining this.


Have fun