# Blosxom Plugin: paragraph # Author: Bob Schumaker # Version: 0 # http://www.cobblers.net/blog/ # License: Public Domain package paragraph; # --- Plug-in package variables ----- # Where the letter pictures are $letterurl = "http://%hostname%/letters"; # The file extension for the letters $letterext = "gif"; # The font size for the paragraph leader $fontsize = 4; # The font color for the paragraph leader $fontcolor = "663333"; # Always do paragraphs? Read from config.paragraph, usually $paragraph_on = 0; # The default style, if one isn't specified $paragraph_default_style = "font"; # --- Configurable variables ----- # What flag in your weblog entries lets me know to turn on paragraph translation? my $paragraph_on_flag = ""; # -------------------------------- my $package = "paragraph"; sub start { 1; } sub head { my($pkg, $path, $head_ref) = @_; for (;;) { do { -r "$blosxom::datadir/$path/config.$package" and require "$blosxom::datadir/$path/config.$package" and last; } while ($path =~ s/(\/*[^\/]*)$// and $1); last; } if( defined($hostinfo::do_replacement) ) { $letterurl = &{$hostinfo::do_replacement}($letterurl); } 1; } sub story { my ($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) = @_; $$body_ref =~ s/$paragraph_on_flag//mi or $paragraph_on or return 0; my $style = $1 || $paragraph_default_style; return 0 unless( $style eq "graphic" or $style eq "font" ); if( $style eq "graphic" ) { $$body_ref =~ s{

(.)}{

$1}gm; } else { $$body_ref =~ s{

(.)}{

$1}gm; } 1; } 1; __END__ =head1 NAME Blosxom Plug-in: paragraph =head1 DESCRIPTION Style your story with dropcaps at the beginning of all the paragraphs. Activate the plugin by including a line of the form