Bernard Simon > App-Followme-0.90 > App::Followme::ConvertPages

Download:
App-Followme-0.90.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.90   Source   Latest Release: App-Followme-0.92

NAME ^

App::Followme - Simple static web site maintenance

SYNOPSIS ^

    use App::Followme::ConvertPages;
    my $converter = App::Followme::ConvertPages->new($configuration);
    $converter->run();

DESCRIPTION ^

If there are any text files in the directory, they are converted into html files by substituting the content into a template. After the conversion the original file is deleted. Along with the content, other variables are calculated from the file name and modification date. Variables in the template are surrounded by double braces, so that a link would look like:

    <li><a href="{{url}}">{{title}}</a></li>

The string which indicates a variable is configurable. The variables that are calculated for a text file are:

body

All the content of the text file. The content is passed through a subroutine before being stored in this variable. The subroutine takes one input, the content stored as a string, and returns it as a string containing html. The default subroutine, add_tags in this module, only surrounds paragraphs with p tags, where paragraphs are separated by a blank line. You can supply a different subroutine by changing the value of the configuration variable page_converter.

title

The title of the page is derived from the file name by removing the filename extension, removing any leading digits,replacing dashes with spaces, and capitalizing the first character of each word.

time fields

The variables calculated from the modification time are: weekday, month, monthnum, day, year, hour24, hour, ampm, minute, and second.

CONFIGURATION ^

The following parameters are used from the configuration:

absolute

If true, urls in a page will be absolute

quick_update

Only convert files in current directory

page_template

The path to the template used to create a page, relative to the top directory.

text_extension

The extension of files that are converted to web pages.

web_extension

The extension used by web pages. The default value is html

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>

syntax highlighting: