blib/lib/Kwiki/PageInclude.pm

filter: Statementstmt 33.3% 1 / 3 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 1 / 1 Podpod n/a totaltotal 50.0% 2 / 4 CC 1 SCAR 2.6
CC
1
Cov
33%
BEGIN
1.3
CRAP 1.3
↑ Summary
1 package Kwiki::PageInclude;
2 0 ▶use Kwiki::Plugin -Base;
Subroutine BEGIN: called CC=1 SCAR=2.6
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__
↑ Summary