line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Livedoor::Wiki::Plugin::Block::DL; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
33
|
use warnings; |
|
5
|
|
|
|
|
14
|
|
|
5
|
|
|
|
|
218
|
|
4
|
5
|
|
|
5
|
|
31
|
use strict; |
|
5
|
|
|
|
|
13
|
|
|
5
|
|
|
|
|
182
|
|
5
|
5
|
|
|
5
|
|
29
|
use base qw(Text::Livedoor::Wiki::Plugin::Block); |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
1006
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub check { |
8
|
209
|
|
|
209
|
1
|
364
|
my $class = shift; |
9
|
209
|
|
|
|
|
402
|
my $line = shift; |
10
|
209
|
|
|
|
|
282
|
my $args = shift; |
11
|
209
|
|
|
|
|
335
|
my $on_next = $args->{on_next}; |
12
|
209
|
|
|
|
|
385
|
my $id = $args->{id}; |
13
|
209
|
100
|
|
|
|
791
|
if( my( $title , $description ) = $line =~ /^:([^\|]*)\|(.*)/ ) { |
14
|
4
|
|
|
|
|
28
|
return { id => $id , title => $title , description => $description }; |
15
|
|
|
|
|
|
|
} |
16
|
205
|
|
|
|
|
936
|
return; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub get { |
21
|
2
|
|
|
2
|
1
|
4
|
my $class = shift; |
22
|
2
|
|
|
|
|
4
|
my $block = shift; |
23
|
2
|
|
|
|
|
4
|
my $inline = shift; |
24
|
2
|
|
|
|
|
4
|
my $items = shift; |
25
|
2
|
|
|
|
|
6
|
my $id = $items->[0]{id}; |
26
|
2
|
|
|
|
|
4
|
my $inlines = ''; |
27
|
2
|
|
|
|
|
6
|
for (@$items) { |
28
|
3
|
|
|
|
|
13
|
$inlines .= $class->item($inline, $_); |
29
|
|
|
|
|
|
|
} |
30
|
2
|
|
|
|
|
14
|
return qq|\n$inlines \n|; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub item { |
34
|
3
|
|
|
3
|
1
|
6
|
my $class = shift; |
35
|
3
|
|
|
|
|
6
|
my $inline = shift; |
36
|
3
|
|
|
|
|
5
|
my $item = shift; |
37
|
3
|
|
|
|
|
15
|
my $dt = $inline->parse( $item->{title} ); |
38
|
3
|
|
|
|
|
16
|
my $dd = $inline->parse( $item->{description} ); |
39
|
3
|
|
|
|
|
10
|
my $line = "$dt$dd\n"; |
40
|
3
|
|
|
|
|
13
|
return $line; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 NAME |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Text::Livedoor::Wiki::Plugin::Block::DL - Definition List Block Plugin |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 DESCRIPTION |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Definition list |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 SYNOPSIS |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
:word|description here |
57
|
|
|
|
|
|
|
:word|description here |
58
|
|
|
|
|
|
|
:word|description here |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 FUNCTION |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head2 check |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head2 get |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head2 item |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 AUTHOR |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
polocky |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=cut |