?

Log in

No account? Create an account

Thu, Jun. 22nd, 2006, 01:00 pm
A splash of hubris and a slight turd polishing

I finally got round to doing something I've been threatening to do for ages - which is automatically generating my CV in multiple formats from one source.

It actually turned out to be quite easy and I wish I'd done it before. Of course it was helped by the awesome and new PDF::API2::Simple which basically did exactly what I was thinking of doing without me having to do it. for t3h w1N!!1111.

Currently it can output Text, HTML, PDF and Doc (technically RTF with a .doc file extension) which should be enough for anyone.

Over the weekend I abstracted out the stuff that controls look and feel (sort of) so that each someone else can make everything look different by writing an .ini style file. There's a default file contained within the CV::Style module which looks something like

    [title]
    font        = Helvetica
    font-size   = 20
    font-colour = #c0c0c0
    font-weight = bold
    font-style  = italic
    align       = left

or something. That's a slightly contrived example but it borrows heavily from CSS.

There's still some hard coding for the order of things, padding in a couple (RTF, PDF) filters and how urls look and titles. Also, most output filters don't understand font-styles other than italic or font-decoration like underline.

I'm pondering allowing each section to have call backs for transforming the object so that instead of the current system wherby the name of the CV is always prefixed with '::' (because I think it look arty like) and titles always look like '[ title ]' and urls look like '< url >' you'll be able to do

    [name]
    callback = sub { my $name = shift; return ":: $name"; }
    [title]
    callback = sub { my $title = shift; return "[ $title ]"; }
    [url]
    callback = sub { my $url = shift; return "< $url >"; }

or something.