Papery::Pulp - The pulp of the Papery workflow
# 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 }
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.
Papery::Pulp
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.
Papery::Analyzer
Papery::Processor
Papery::Renderer
Papery::Pulp provides the following methods:
Create a new Papery::Pulp object, initialized with the metadata in $meta.
$meta
Analyze the $file file (relative to the source directory) using the configured analyzer class and update the object accordingly.
$file
Process the object using the configured processor class and update it accordingly.
Render the object using the configured renderer class and update it accordingly.
Save the generated output to the _permalink file.
_permalink
Merge the $meta metadata into the object, using Papery::Util::merge_meta().
Papery::Util::merge_meta()
Philippe Bruhat (BooK), <book at cpan.org>
<book at cpan.org>
Copyright 2010 Philippe Bruhat (BooK), all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Papery, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Papery
CPAN shell
perl -MCPAN -e shell install Papery
For more information on module installation, please visit the detailed CPAN module installation guide.