File Coverage

blib/lib/Kwiki/PageInclude.pm
Criterion Covered Total %
statement 1 3 33.3
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 2 4 50.0


line stmt bran cond sub pod time code
1             package Kwiki::PageInclude;
2 1     1   1066 use Kwiki::Plugin -Base;
  0            
  0            
3             our $VERSION = '0.02';
4              
5             const class_id => 'page_include';
6             const class_title => 'Include Other Page';
7              
8             sub register {
9             my $reg = shift;
10             $reg->add(wafl => include => 'Kwiki::PageInclude::WaflPhrase');
11             }
12              
13             package Kwiki::PageInclude::WaflPhrase;
14             use base 'Spoon::Formatter::WaflPhrase';
15              
16             sub to_html {
17             my @args = split(/[\s,]+/,$self->arguments);
18             my $ret;
19             for(@args) {
20             my $page = $self->hub->pages->new_from_name($_);
21             $ret .= $self->hub->formatter->text_to_html($page->content);
22             }
23             return $ret;
24             }
25              
26             __END__