tagging: Allow using titles in for related stories.
[matthijs/upstream/blosxom-plugins.git] / general / foreshortened
1 # Blosxom Plugin: foreshortened
2 # Author(s): Rael Dornfest <rael@oreilly.com> 
3 # Version: 2.0b1
4 # Documentation: See the bottom of this file or type: perldoc foreshortened
5
6 package foreshortened;
7
8 # --- Configurable variables -----
9
10 # --------------------------------
11
12 $body; # use as $foreshortened::body in flavour templates
13
14 sub start {
15   1;
16 }
17
18 sub story {
19   my($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) = @_;
20
21   $body = $$body_ref;
22   $body =~ s/<.+?>//gs;
23   $body =~ s/[\.\!\?].+$/.../s;
24
25   1;
26 }
27
28 1;
29
30 __END__
31
32 =head1 NAME
33
34 Blosxom Plug-in: foreshortened
35
36 =head1 SYNOPSIS
37
38 Purpose: Populates $foreshortened::body with the first sentence
39 (defined as everything before the first ., !, or ?) and strips out
40 HTML tags along the way.  Perfect for providing shortened, plaintext 
41 versions of stories for an RSS feed.
42
43 =head1 VERSION
44
45 2.0b1
46
47 Version number coincides with the version of Blosxom with which the 
48 current version was first bundled.
49
50 =head1 AUTHOR
51
52 Rael Dornfest  <rael@oreilly.com>, http://www.raelity.org/
53
54 This plugin is now maintained by the Blosxom Sourceforge Team,
55 <blosxom-devel@lists.sourceforge.net>.
56
57 =head1 SEE ALSO
58
59 Blosxom Home/Docs/Licensing: http://blosxom.sourceforge.net/
60
61 Blosxom Plugin Docs: http://blosxom.sourceforge.net/documentation/users/plugins.html
62
63 =head1 BUGS
64
65 None known; please send bug reports and feedback to the Blosxom
66 development mailing list <blosxom-devel@lists.sourceforge.net>.
67
68 =head1 LICENSE
69
70 Blosxom and this Blosxom Plug-in
71 Copyright 2003, Rael Dornfest 
72
73 Permission is hereby granted, free of charge, to any person obtaining a
74 copy of this software and associated documentation files (the "Software"),
75 to deal in the Software without restriction, including without limitation
76 the rights to use, copy, modify, merge, publish, distribute, sublicense,
77 and/or sell copies of the Software, and to permit persons to whom the
78 Software is furnished to do so, subject to the following conditions:
79
80 The above copyright notice and this permission notice shall be included
81 in all copies or substantial portions of the Software.
82
83 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
84 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
85 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
86 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
87 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
88 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
89 OTHER DEALINGS IN THE SOFTWARE.