corrects the $recurse_into_story feature in XML flavours ; clarify documentation
[matthijs/upstream/blosxom-plugins.git] / general / readme
1 # Blosxom Plugin: readme
2 # Author(s): Rael Dornfest <rael@oreilly.com> 
3 # Version: 2003-11-12
4 # Documentation: See the bottom of this file or type: perldoc readme
5
6 package readme;
7
8 # --- Configurable variables -----
9
10 my $before_readme = qq{<span class="readme">};
11 my $after_readme = qq{</span>};
12
13 # --------------------------------
14
15 $readme; # use as $readme::readme in flavour templates
16
17 use FileHandle;
18
19 my $fh = new FileHandle;
20
21 sub start {
22   1;
23 }
24
25 sub head {
26   my($pkg, $path, $head_ref) = @_;
27
28   LOOK: {
29     do {
30       $fh->open("< $blosxom::datadir/$path/readme") || $fh->open("< $blosxom::datadir/$path/readme.$blosxom::flavour") and $readme = join('', $before_readme, <$fh>, $after_readme), $fh->close, last LOOK;
31     } while ($path =~ s/(\/*[^\/]*)$// and $1);
32   }
33   
34   return 1;
35 }
36
37 1;
38
39 __END__
40
41 =head1 NAME
42
43 Blosxom Plug-in: readme
44
45 =head1 SYNOPSIS
46
47 Purpose: Populates $readme::readme with the contents of any readme.flavour
48 (specific to a particular flavour) or readme (general, regardless of flavour)
49 file found along a particular category path/directory, preferring those found 
50 closest to the point of the path at hand.
51
52 =head1 VERSION
53
54 2003-11-12
55
56 Version number coincides with the version of Blosxom with which the 
57 current version was first bundled.
58
59 =head1 AUTHOR
60
61 Rael Dornfest  <rael@oreilly.com>, http://www.raelity.org/
62
63 This plugin is now maintained by the Blosxom Sourceforge Team,
64 <blosxom-devel@lists.sourceforge.net>.
65
66 =head1 SEE ALSO
67
68 Blosxom Home/Docs/Licensing: http://blosxom.sourceforge.net/
69
70 Blosxom Plugin Docs: http://blosxom.sourceforge.net/documentation/users/plugins.html
71
72 =head1 BUGS
73
74 None known; please send bug reports and feedback to the Blosxom
75 development mailing list <blosxom-devel@lists.sourceforge.net>.
76
77 =head1 LICENSE
78
79 Blosxom and this Blosxom Plug-in
80 Copyright 2003, Rael Dornfest 
81
82 Permission is hereby granted, free of charge, to any person obtaining a
83 copy of this software and associated documentation files (the "Software"),
84 to deal in the Software without restriction, including without limitation
85 the rights to use, copy, modify, merge, publish, distribute, sublicense,
86 and/or sell copies of the Software, and to permit persons to whom the
87 Software is furnished to do so, subject to the following conditions:
88
89 The above copyright notice and this permission notice shall be included
90 in all copies or substantial portions of the Software.
91
92 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
93 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
94 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
95 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
96 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
97 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
98 OTHER DEALINGS IN THE SOFTWARE.