anm - print HTML anchor crossreferences

After I had marked up my first bits of hypertext, the comp.lang.c Frequently Asked Questions list, I realized that I would be lost without an automatic cross reference checker.  I didn't have trouble with the HTML markup as such; an SGML parser (James Clark's sgmls), a small shell script, and a watered-down document type definition took care of that.  But my anchors and names didn't always match, and I couldn't find a tool that would check them. 

Since my subtrees were local, my tool wouldn't have to speak HTTP; it would suffice to just decode filenames in the URLs, find the documents if they're local, and grep them for anchors.  Neither MIME nor SGML would have to be involved; the sequence <a is rare, and the input routines could be made stable enough to stomach the occasional false alarm.

The result of my first attempt, written as a quick hack to fill my immediate needs, is anm (a for anchor, nm for nm(1)).  Its architecture is typical for the quick hacks I'm writing these days: first it gobbles up all the data it can find, then thinks about it, then prints it annotated with a bit of information that the reader, I hope, will find useful. 

If you would like to test anm, you're welcome to a uuencoded, gzip'ed tar-file of the current beta-release, a sample run over this page, or a marked-up version of the anm manual page.  

[2010: I can't find the source code for this, either - I guess it went down when was decomissioned.]