# $Id$
use Text::Wrap qw(wrap);
use vars qw(%DISPATCH $ME $TODAY);
%DISPATCH = (
b => sub { "$_[2] " },
i => sub { "$_[2] " },
u => sub { "$_[2] " },
strong => sub { "$_[2] " },
em => sub { "$_[2] " },
br => sub { "
\n" },
a => \&a,
resume => \&resume,
author => \&author,
address => \&address,
education => \&education,
school => \&school,
experience => \&experience,
employer => \&employer,
skills => \&skills,
skill => \&skill,
references => \&references,
);
sub education { header('Education') . $_[2] }
sub experience { header('Work Experience') . $_[2] }
sub skills { header('Applicable Job Skills') . "
', $text, '
'), "\n"; } sub employer { my($tag, $attribute, $text) = @_; my($name, $location, $dates, $position, $href) = map { $attribute->{$_} } qw(name location dates position href); return join '', _indent(2, '', $position, '. ', $text, '
' ), "\n"; } sub skill { my($tag, $attribute, $text) = @_; return '' unless $text; return _indent(3, join $text, '', $text, '
') . "\n"; } sub _link($$) { my $text = shift || return ''; my $href = shift; $href ? $href =~ /^mailto\:/ ? qq($text) : qq($text) : $text ; } sub _indent { my($indent, @text) = @_; return '' unless @text; $indent = '' unless defined $indent; $indent = ' ' x $indent if $indent =~ /^\d+$/; return wrap($indent, $indent . ' ', join '', @text) . "\n"; } 1;