use App::Followme::FileData; my $data = App::Followme::FileData->new(); my $html = App::Followme::Template->new('example.htm', $data);
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.
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.
The file metadata class can evaluate the following variables. When passing a name to the build method, the sigil should not be used.
The main content of the file.
A one sentence description of the file contents
The creation date of a file. The display format is controlled by the configuration variable, data_format
A summary of the file's contents, by default the first paragraph.
The title of the file, either derived from the content or the file metadata.
This class has the following configuration variable:
The top directory containing the files to be processed
A set of html tags that bound the title in the file's contents. The default value is "<h1></h1>".
Copyright (C) Bernie Simon.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Bernie Simon <firstname.lastname@example.org>