App-Followme
view release on metacpan or search on metacpan
lib/App/Followme/PodData.pm view on Meta::CPAN
#----------------------------------------------------------------------
# Initialize pod parser and find pod directory
sub setup {
my ($self) = @_;
my ($pod_folder, $package_path) = $self->find_base_directory();
die "Couldn't find folder for $self->{package}"
unless defined $pod_folder;
$self->{final_directory} = $self->{base_directory};
$self->{base_directory} = catfile($pod_folder, @$package_path);
$self->{package} = join('::', @$package_path);
return;
}
1;
__END__
=encoding utf-8
=head1 NAME
App::Followme::PodData - Convert Pod files to html
=head1 SYNOPSIS
use App::Followme::PodData;
my $data = App::Followme::PodData->new();
my $html = App::Followme::Template->new('example.htm', $data);
=head1 DESCRIPTION
This module converts Perl files with POD markup into html and extracts the
metadata from the html.
=head1 METHODS
All data are accessed through the build method.
=over 4
=item my %data = $obj->build($name, $filename);
Build a variable's value. The first argument is the name of the variable. The
second argument is the name of the file the metadata is being computed for. If
it is undefined, the filename stored in the object is used.
=back
=head1 VARIABLES
The Pod metadata class can evaluate the following variables. When passing
a name to the build method, the sigil should not be used.
=over 4
=item $body
All the contents of the file, minus the title if there is one.
Pod::Simple::XHTML is called on the file's content to generate html
before being stored in the body variable.
=item $description
A one line sentence description of the content.
=item $title
The title of the page is derived from contents of the top header tag, if one is
at the front of the file content, or the filename, if it is not.
=back
=head1 CONFIGURATION
The following parameters are used from the configuration:
=over 4
=item pod_extension
The extension of files that contain pod documentation. The default value
is pm,pod.
=item pod_directory
The directory containing the pod files
=back
=head1 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.
=head1 AUTHOR
Bernie Simon E<lt>bernie.simon@gmail.comE<gt>
=cut
( run in 1.267 second using v1.01-cache-2.11-cpan-85f18b9d64f )