SVG Calendars

Volume 15, Issue 4; 31 Jan 2012

A little XQuery magic for making SVG calendars.

For several years, I've been making a calendar every month and sticking it on the refrigerator. It's got my travel information, holidays, and other events pulled from my diary.

The mechanics were pretty convoluted: generate the calendar grid with some SVG, convert that to PNG at 150dpi, open Photoshop and create a new 8½x11 page, open an image file, combine the bits and pieces and print it out.

Yesterday, I realized I was working way too hard.

This evening, I souped up the XQuery script that generates the calendar grid to do the rest of the work too. You can get it from https://github.com/ndw/svgcal or see it live in action at http://svgcal.nwalsh.com/.

On my system, calevents.xqy consults my calendar database and returns a summary of the actual events. For the distribution, I just stuck in a stub that generates some random events for display purposes.

There's probably room to do better. Comments, questions, and suggestions welcome.