Foswiki-to-PDF Makefile

At $WORK I've just switched to using Foswiki (formerly TWiki) for documentation. I miss editing files directly from Emacs like you can with Confluence, but I'll get over it. The main reason I like Foswiki is that, at heart, the source files are plain text, and are available as plain text -- no need to trawl through a database.

Another nice feature that Confluence has is the ability to export a space (Foswiki calls it a web) directly as PDF. A bit of scripting takes care of that, but since this is the second time I've lashed together a Makefile to generate a PDF from Foswiki, I figure it's time to post it.

You can find the Makefile here. It uses lynx, wget and htmldoc; of those, I suppose only htmldoc is hard to replace. There's one important assumption built into the Makefile, though: that every page is linked to from the front page of the web, which is how I organize my pages.

Share and enjoy!

Update: Just showed the boss the printed version, and he was very impressed. Yay me! :-)