There are two great posts over at Linux, Unit, /etc/:

Together they describe both M4 and how to make use of it to carry out some webbish tasks like wrapping content in common markup. I know, I know. “Der, just use WordPress or something.” No. Software comes from somewhere, and the people who make it need to learn how to do things. For every useful and interesting hack there are at least 10 stupid little prototypes, tests, mashups, and minor modifications. The closer your starting point can be to your ending point the better off you (probably) are. More examples using more toolsets for more problems, that’s cool. So generating HTML with a macro processor that has roots back into Fortran, sure, that’s cool. I don’t want to do it right now, but if ever I’m looking for an example to start with I’m sure I’ll be happy it’s there.