NAME
Papery::Analyzer - Base class for Papery analyzers
SYNOPSIS
package Papery::Analyzer::MyAnalyzer;
use strict;
use warnings;
use Papery::Analyzer;
our @ISA = qw( Papery::Analyzer );
sub analyze {
my ( $class, $pulp ) = @_;
# analyze $pulp->{meta}{_source}
# update $pulp->{meta}{_text}
return $pulp;
}
1;
DESCRIPTION
Papery::Analyzer
is the base class for Papery analyzer classes. Subclasses only need to define an analyze()
method, taking a Papery::Pulp
object as the single parameter.
The analyze()
method is expected to take the _source
key from the Papery::Pulp
object and use it to update the _text
key, that will be later processed by Papery::Processor
classes.
METHODS
This class provides several methods:
- analyze_file( $pulp, $path )
-
Analyze the file under
$path
and update the$pulp
object.$path
is relative to__source
. - analyze( $pulp )
-
Analyze the
_source
metadata, extract the YAML Front Matter, and update the$pulp
metadata and_text
.
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.