NAME

Posy::Plugin::EntryTitles - Posy plugin to cache entry titles

VERSION

This describes version 0.40 of Posy::Plugin::EntryTitles.

SYNOPSIS

    @plugins = qw(Posy::Core
		  Posy::Plugin::EntryTitles
		  ...
		  ));
    @actions = qw(
	....
	index_entries
	index_titles
	...
	);

DESCRIPTION

This is a "utility" plugin to be used by other plugins; it maintains a list (and cache) of entry titles in $self->{titles} which can be used by other plugins (such as Posy::Plugin::NearLinks).

It provides an action method "index_titles" which should be put after "index_entries" in the action list.

This plugin is useful not only for efficiency reasons, but it means that other plugins don't have to know how to extract the title from a given format of file; the title for a HTML file, for example, is not parsed in the same way as that for a plain text file. Those who wish to introduce additional formats need only override the "get_title" method and everything will work just as smoothly. Ah, inheritance, I love it.

Configuration

The following config values can be set:

titles_cachefile

The full name of the file to be used to store the cache. Most people can just leave this at the default.

OBJECT METHODS

Documentation for developers and those wishing to write plugins.

init

Do some initialization; make sure that default config values are set.

Flow Action Methods

Methods implementing actions.

index_titles

Find the titles of the entry files. This uses caching by default.

Expects $self->{config} and $self->{files} to be set.

Helper Methods

Methods which can be called from elsewhere.

get_title

$title = $self->get_title($file_id);

Get the title of the given entry file (by reading the file). (If you are introducing a new file-type, you should override this)

Private Methods

Methods which may or may not be here in future.

_et_init_caching

Initialize the caching stuff used by index_entries

_et_read_cache

Reads the cached information used by index_entries

_et_save_cache

Saved the information gathered by index_entries to caches.

REQUIRES

Posy
Posy::Core

Test::More

SEE ALSO

perl(1). Posy Posy::Plugin::TextTemplate Posy::Plugin::NearLinks

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-2005 by Kathryn Andersen

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.