The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Contentment::FileType::POD - A file type plugin for handling Plain Old Documentation

DESCRIPTION

This is a generated specifically geared for use with Perl's POD, or Plain Old Documentation, format. This class inherits from Contentment::FileType::Other.

$test = Contentment::FileType::POD->filetype_match($file)

Returns true if the file name ends with ".pod" or ".pm". Returns false otherwise.

$kind = Contentment::FileType::POD->real_kind($file)

Returns "text/x-pod" if the file name ends with ".pod" or "text/x-perl" otherwise.

@properties = Contentment::FileType::POD->properties($file)

Returns the list of properties for the file.

$value = Contentment::FileType::POD->get_property($file, $value)

This method returns properties detected in one of two ways. First, the "title" and "abstract" properties are detected by searching for a heading named "NAME". The next non-blank line formated like "title - abstract" is then used to file those fields. For example,

  =head1 NAME

  Contentment::FileType::POD - A file type plugin for handling Plain Old Documentation

This fragment would give us a property named "title" of "Contentment::FileType::POD" and a property named "abstract" of "A file type plugin for handling Plain Old Documentation".

The second way is to searches the file for "meta" sections. This uses the "=begin"/"=end" and "=for" sections. Each property is a Perl word followed by a "=>" and then a Perl string. For example,

  =begin meta
  date           => "2005-3-17 7:23"
  author         => q(Andrew Sterling Hanenkamp)
  favorite_movie => 'Napoleon Dynamite'
  =end meta

  =for meta foo => 'Quick property.'

Here we would have a property named "date" of "2005-3-17 7:23", "author" of "Andrew Sterling Hanenkamp", "favorite_movie" of "Napoleon Dynamite", and "foo" of "Quick property."

SEE ALSO

Contentment::FileType::Other, perlpod

AUTHOR

Andrew Sterling Hanenkamp, <hanenkamp@users.sourceforege.net>

COPYRIGHT AND LICENSE

Copyright 2005 Andrew Sterling Hanenkamp. All Rights Reserved.

Contentment is distributed and licensed under the same terms as Perl itself.