NAME

App::Followme::FileData

SYNOPSIS

use App::Followme::FileData;
my $data = App::Followme::FileData->new();
my $html = App::Followme::Template->new('example.htm', $data);

DESCRIPTION

This module extracts data from a file. It assumes the file is a text file with the metadata in a nested text block preceding a content block that is in html format or convertible to html format. The two sections are separated by a line of three or more dots. These asumptions can be overriden by overriding the methods in the class. Like the other data classes, this class is normally called by the Template class and not directly by user code.

METHODS

All data classes are first instantiated by calling new and the object created is passed to a template object. It calls the build method with an argument name to retrieve that data item, though for the sake of efficiency, all the data are read from the file at once.

VARIABLES

The file metadata class can evaluate the following variables. When passing a name to the build method, the sigil should not be used.

$body

The main content of the file.

$description

A one sentence description of the file contents

$date

The creation date of a file. The display format is controlled by the configuration variable, data_format

$summary

A summary of the file's contents, by default the first paragraph.

$title

The title of the file, either derived from the content or the file metadata.

CONFIGURATION

This class has the following configuration variable:

base_directory

The top directory containing the files to be processed

title_template

A set of html tags that bound the title in the file's contents. The default value is "<h1></h1>".

LICENSE

Copyright (C) Bernie Simon.

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

AUTHOR

Bernie Simon <bernie.simon@gmail.com>