# Blosxom Plugin: raa_tag
# Author: Dean Wilson 
# Version: 0.1 (20050604)
# Plugin Homepage: http://www.unixdaemon.net/blosxom_plugins.html#raa_tag
# License: GPL
# Documentation: Please see the end of this file.

package raa_tag;

sub start {
  1;
}


sub story {
  my ($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) = @_;

  $$body_ref =~ s!<raa\s+"([^"]+)"\s*/?>!<a href="http://raa.ruby-lang.org/project/$1">$1</a>!sg;
  $$body_ref =~ s!<a\s+href="raa:([^"]+)"\s*/?>!<a href="http://raa.ruby-lang.org/project/$1">$1</a>!gs;
  $$body_ref =~ s!<raa>([^>]*)</raa>!<a href="http://raa.ruby-lang.org/project/$1">$1</a>!sg;

  1;
}

1;

__END__

=head1 NAME

Blosxom Plugin: raa_tag

=head1 SYNOPSIS


This extension allows you to link to Ruby Application Archive
hosted projects in your blog posts without performing the tedious
steps of looking up the module, getting the URL, putting it in an
<a href=""> etc.

You can specify a link to a project using any of the following shortcuts:

 <raa "net-ssh">
 <a href="raa:needle">
 <raa>copland</raa>

And it will be translated in to a full <a href=""> that points to the
module on the RAA site.

=head1 VERSION

0.1

=head1 AUTHOR

Dean Wilson 

=head1 LICENSE

GPL

=cut
