Take me over?
NAME
Posy::Plugin::ShortBody - Posy plugin to give the start of an entry body
VERSION
This describes version 0.01 of Posy::Plugin::ShortBody.
SYNOPSIS
@plugins = qw(Posy::Core Posy::Plugin::ShortBody));
@entry_actions = qw(header
entry_template
read_entry
parse_entry
short_body
render_entry
append_entry
);
DESCRIPTION
Purpose: Populates the flavour template variable $entry_short_body with the first sentence of the entry body (defined as everything before the first ., !, or ?) and strips out HTML tags along the way. Perfect for providing shortened, plaintext versions of stories for an RSS feed.
This creates a 'short_body' entry action, which should be placed after 'parse_entry' in the entry_action list.
Configuration
This expects configuration settings in the $self->{config} hash, which, in the default Posy setup, can be defined in the main "config" file in the data directory.
- short_body_remove_header
-
If true, removes the first header it encounters in the body, and uses the first sentence after that. (1 is true, 0 is false) (default: true)
OBJECT METHODS
Documentation for developers and those wishing to write plugins.
init
Do some initialization; make sure that default config values are set.
Entry Action Methods
Methods implementing per-entry actions.
short_body
$self->short_body(\%flow_state, \%current_entry, \%entry_state)
Parses $current_entry->{body} into $current_entry->{short_body}
REQUIRES
HTML::ShortBody
Test::More
SEE ALSO
perl(1). Posy
BUGS
Please report any bugs or feature requests to the author.
AUTHOR
Kathryn Andersen (RUBYKAT)
perlkat AT katspace dot com
http://www.katspace.com
COPYRIGHT AND LICENCE
Copyright (c) 2004 by Kathryn Andersen
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.