Global Moxie

http://globalmoxie.com/blog/osx-w3c-html-validator.shtml

Don't Procrastinate... Validate! Installing a HTML Validator on OSX

Are you a web developer who works on a Mac? Did you know that you can install the W3C's HTML validator directly on your Mac?

By

Are you a web developer who works on a Mac? Did you know that you can install the W3C's HTML validator directly on your Mac? This means you can check your web pages for HTML errors when you're offline or if you're working on a page that's not accessible from the public internet (e.g., your Mac's built-in web server).

Lord knows I'm no neat freak. As I write this, I'm surrounded by three half-empty coffee cups and a desk half-buried in books and scribbled notes. But when it comes to the guts of my programs and web pages, some little voice takes over from deep inside. A little voice with OCD tendencies. The fresh-scrubbed Howard Hughes of little voices.

I love me some pristine code. Like others who share my prediliction for meticulous markup, I check my web page creations with a HTML validator, a program that lists any errors or, better yet, awards me with a gold star and a pat on the head if my markup comes up clean.1

You can check your page syntax for free with the HTML validator provided by the W3 Consortium, the folks who came up with the HTML standard in the first place: http://validator.w3.org/.

Trouble is, the W3C validator can only access pages that are available on the public web. And of course you have to be online yourself. Not a huge deal, but a mild inconvenience.

Several months ago, though, I realized that you can install the W3C's HTML validator on your own computer. I dropped it into my laptop, where I do most of my design and development work. Tada, I've got my own validation server right on my laptop. Now it's super-easy to check any page, online or offline, from my browser. Cool, that's handy.

But then I also realized that I could create a program to check all of Big Medium's pages automatically. I wrote a little spider program that signs into my development version of Big Medium and submits the control-panel pages to the validator.

That means that all of my development and testing needs for Big Medium are totally self-contained in my Mac laptop with its built-in Apache server and HTML validator. I don't even have to be online. I can satisfy my inner neat freak no matter where I am: on a plane, in a park, at a cafe, wherever.

The Apple Developer Connection site has complete details for installing the validator on OSX.

If you're a Firefox fan who uses the excellent Web Developer toolbar extension, you can tell it to use your private HTML validator instead of the W3C site. The toolbar's Options menu lets you specify the URL to use; give it the URL of your Mac's validator, and you're all set.

1. Alas, the blog pages of this site do not yield valid markup, thanks to the Flickr badge in the right column that displays my latest photo. That one's not in my control, though, so we must treat it with benign neglect. [back]

Tags: , ,