NAME
App::Followme::CreateIndex - Create index file for a directory
SYNOPSIS
use App::Followme::CreateIndex;
my $indexer = App::Followme::CreateIndex->new($configuration);
$indexer->run($directory);
DESCRIPTION
This package builds an index for a directory containing links to all the files and directories contained in it. template. The variables described below are substituted into a template to produce the index. Loop comments that look like
<!-- loop -->
<!-- endloop -->
indicate the section of the template that is repeated for each file contained in the index.
- 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.
- url
-
The relative url of each file.
- time fields
-
The variables calculated from the modification time are:
weekday, month,
monthnum, day, year, hour24, hour, ampm, minute,
andsecond.
CONFIGURATION
The following fields in the configuration file are used:
- absolute
-
If true, urls in a page will be absolute
- include_directories
-
If true, subdirectories will be included in the index
- index_include
-
A comma separated list of filename patterns used to create the index
- index_file
-
Name of the index file to be created
- index_template
-
The path to the template file, relative to the base directory.
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>