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::Pulpobject, initialized with the metadata in$meta. - analyze_file( $file )
-
Analyze the
$filefile (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
_permalinkfile. - merge_meta( $meta )
-
Merge the
$metametadata into the object, usingPapery::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.