File Coverage

blib/lib/Kwiki/Formatter/Note.pm
Criterion Covered Total %
statement 7 9 77.7
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 10 12 83.3


line stmt bran cond sub pod time code
1             package Kwiki::Formatter::Note;
2              
3 1     1   25245 use warnings;
  1         3  
  1         52  
4 1     1   6 use strict;
  1         2  
  1         38  
5 1     1   463 use Kwiki::Plugin '-Base';
  0            
  0            
6             use mixin 'Kwiki::Installer';
7             our $VERSION = '0.01';
8              
9             const class_title => 'Wiki Note';
10             const class_id => 'wikinote';
11             const css_file => 'note.css';
12              
13             sub register {
14             my $registry = shift;
15             $registry->add(preload => $self->class_id);
16             $registry->add(hook => 'formatter:all_blocks',
17             post => 'add_note_to_list',
18             );
19             }
20              
21             sub init {
22             super;
23             my $formatter = $self->hub->load_class('formatter');
24             $formatter->table->{note} = 'Kwiki::Formatter::Note::Block';
25             }
26              
27             sub add_note_to_list {
28             return [('note', @{$_[-1]->returned})];
29             }
30              
31             package Kwiki::Formatter::Note::Block;
32             use Spoon::Base -Base;
33             use base 'Spoon::Formatter::Block';
34              
35             const formatter_id => 'note';
36             const pattern_block => qr/^NOTE:\s*(.+?)\s*\n/m;
37             const html_start => q{
Note};
38             const html_end => q{
};
39              
40             package Kwiki::Formatter::Note;
41             1; # End of Kwiki::Formatter::Note
42              
43             __DATA__