NAME ^

Parrot::Docs::File - Docs-Related File

SYNOPSIS ^

        use Parrot::Docs::File;
        my $file = Parrot::Docs::File->new('MANIFEST');

DESCRIPTION ^

This Parrot::IO::File subclass adds a few documentation-related methods to do with POD and file type.

It's used by the documentation tools in tools/docs.

Class Methods ^

type_for_suffix($suffix)

This is a class method that converts a file suffix to a description of the type of files which have this suffix.

type_for_name($name)

This is a class method that converts a file name to a description of the type of files which have this name.

Instance Methods ^

type()

This first tries to find a type for the file's suffix, failing that it looks at the file's name. If it fails for both it returns 'Undefined'.

is_of_type($type)

Returns whether the file is of the specified type.

check_pod()

Runs Pod::Simple::Checker on the contents of the file. Executable files, and *.dump files are assumed not to contain POD and therefore not checked.

Note that the results are cached and the POD will only be rechecked if the file has been modified since it was checked.

contains_pod()

Tells you whether there is any POD formatted documentation in the file. Executable files are assumed not to contain POD.

num_pod_errors()

Tells you the number of POD errors in the file.

pod_errors($options)

Gives you a description of any POD errors in the file.

pod_as_html()

Runs Parrot::Docs::POD2HTML on the contents of the file. Executable files are assumed not to contain POD and therefore not formatted.

is_docs_link()

Returns whether the file is suitable for inclusion in a documentation link.

If a file contains plain text rather than POD it may be directly linked to.

title()

Returns the title of the file.

short_description()

Returns a short description of the file extracted from the NAME section of the POD documentation, if it exists. If an ABSTRACT is found then that is preferred.

SEE ALSO ^

Parrot::Docs::Directory

Parrot::Docs::POD2HTML

Pod::Simple::Checker


parrot