Philippe Bruhat (BooK) > Papery-0.01 > Papery::Pulp

Download:
Papery-0.01.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Source  

NAME ^

Papery::Pulp - The pulp of the Papery workflow

SYNOPSIS ^

    # the Papery workflow

    sub process_file {
        my ( $self, $meta, $file ) = @_;
        return
            map    { $_->save() }                 # will create final files
            map    { $_->render() }               # may insert Papery::Pulp
            map    { $_->process() }              # may insert Papery::Pulp
            map    { $_->analyze_file($file) }    # may insert Papery::Pulp
            Papery::Pulp->new($meta);             # clone $meta
    }

DESCRIPTION ^

The Papery workflow is basically passing around Papery::Pulp objects. The intermediate steps can insert Papery::Pulp objects in the flow, and each of them will be saved in a file at the end.

A Papery::Pulp object carries around the metadata about the thing (usually a file) being processed. It is a simple hash of metadata, that is process through the whole Papery process. It is initialized with the current metadata (global configuration, plus all layers of directory metadata). It is passed to Papery::Analyzer, Papery::Processor and Papery::Renderer objects.

METHODS ^

Papery::Pulp provides the following methods:

new( $meta )

Create a new Papery::Pulp object, initialized with the metadata in $meta.

analyze_file( $file )

Analyze the $file file (relative to the source directory) using the configured analyzer class and update the object accordingly.

process()

Process the object using the configured processor class and update it accordingly.

render()

Render the object using the configured renderer class and update it accordingly.

save()

Save the generated output to the _permalink file.

merge_meta( $meta )

Merge the $meta metadata into the object, using Papery::Util::merge_meta().

AUTHOR ^

Philippe Bruhat (BooK), <book at cpan.org>

COPYRIGHT ^

Copyright 2010 Philippe Bruhat (BooK), all rights reserved.

LICENSE ^

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: