Catalyst-View-Markdown

 view release on metacpan or  search on metacpan

lib/Catalyst/View/Markdown.pm  view on Meta::CPAN

package Catalyst::View::Markdown;

use strict;
use warnings;

use base qw/Catalyst::View/;
use Text::Markdown;
use File::Find;
use MRO::Compat;
use Scalar::Util qw/blessed weaken/;

our $VERSION = '0.01';
$VERSION = eval $VERSION;

__PACKAGE__->mk_accessors('markdown_filename');
__PACKAGE__->mk_accessors('include_path');

*paths = \&include_path;

=head1 NAME

lib/Catalyst/View/Markdown.pm  view on Meta::CPAN


    # Set base include paths. Local'd in render if needed
    $self->include_path($config->{INCLUDE_PATH});

    $self->config($config);

    # Creation of template outside of call to new so that we can pass [ $self ]
    # as INCLUDE_PATH config item, which then gets ->paths() called to get list
    # of include paths to search for templates.

    # Use a weakend copy of self so we dont have loops preventing GC from working
    my $copy = $self;
    Scalar::Util::weaken($copy);
    $config->{INCLUDE_PATH} = [ sub { $copy->paths } ];

    $self->{markdown} =
        $config->{CLASS}->new($config) || do {
            my $error = $config->{CLASS}->error();
            $c->log->error($error);
            $c->error($error);
            return undef;
        };



( run in 0.646 second using v1.01-cache-2.11-cpan-65fba6d93b7 )