# Blosxom Plugin: keywords # Author(s): Guenther H. Zylinsky; Gregor Rayman # Version: 0.1 # Revision: $Id: keywords,v 1.2 2003/11/12 18:57:47 gra Exp $ package sidenotes; # --- Configurable variables ----- my $prefix = "

Siehe auch

  • "; my $suffix = "
"; my $separator = "\n
  • "; $sidenotes = '$sidenotes::sidenotes'; $story = ''; # -------------------------------- my $storysep = ""; my $sep = ""; my %allnotes = {}; sub start { 1; } sub addNote { my ($note) = @_; $story .= $sep . $note; $sep = $separator; if (!$allnotes{$note}) { $sidenotes = $prefix if ($sidenotes eq '$sidenotes::sidenotes'); $sidenotes .= $storysep . $note; $storysep = $separator; $allnotes{$note} = 1; } return ""; } sub story { my($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) = @_; $sep = ""; $story = ""; ## $$body_ref =~ s:\s*(.*?)\s*:($story.=$sep.$1,$sep=$separator,""):ego; $$body_ref =~ s:\s*(.*?)\s*:&addNote($1):egos; return 1; } sub foot { $sidenotes = "" if ($sidenotes eq '$sidenotes::sidenotes'); $sidenotes .= $suffix if $sidenotes; return 1; } sub last { $blosxom::output =~ s!\$\{?sidenotes::sidenotes\}?!$sidenotes!ego; return $blosxom::entries; } 1; __END__ =head1 NAME Blosxom Plug-in: sidenotes =head1 SYNOPSIS Extracts sidenotes embedded as text in individual stories and stores them in the following variables: $sidenotes::sidenotes - from all displayed stories $sidenotes::story - from one story $sidenotes::story can be used in the individual story template (story.flavor) $sidenotes::sidenotes can be used either in head.flavor or in foot.flavor =head1 AUTHOR Gregor Rayman , http://www.grayman.de/ Guenther H. Zylinsky =head1 BUGS Address bug reports and comments to me [mailto:rayman@grayman.de]. =head1 LICENSE Blosxom and this Blosxom Plug-in Copyright 2003, Gregor Rayman, Guenther H. Zylinsky Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.