line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Livedoor::Wiki::Plugin::Function; |
2
|
12
|
|
|
12
|
|
32948
|
use warnings; |
|
12
|
|
|
|
|
25
|
|
|
12
|
|
|
|
|
317
|
|
3
|
12
|
|
|
12
|
|
57
|
use strict; |
|
12
|
|
|
|
|
22
|
|
|
12
|
|
|
|
|
343
|
|
4
|
12
|
|
|
12
|
|
55
|
use base qw(Class::Data::Inheritable); |
|
12
|
|
|
|
|
18
|
|
|
12
|
|
|
|
|
2032
|
|
5
|
|
|
|
|
|
|
__PACKAGE__->mk_classdata('function_name'); |
6
|
|
|
|
|
|
|
__PACKAGE__->mk_classdata('operation_regexp'); |
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
1
|
59
|
sub process { die 'implement me' } |
9
|
3
|
|
|
3
|
1
|
401
|
sub process_mobile { shift->process(@_) } |
10
|
|
|
|
|
|
|
sub prepare_args { |
11
|
6
|
|
|
6
|
1
|
13
|
my $class= shift; |
12
|
6
|
|
|
|
|
10
|
my $args = shift; |
13
|
6
|
|
|
|
|
18
|
return $args; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
sub prepare_value { |
16
|
58
|
|
|
58
|
1
|
117
|
my $class = shift; |
17
|
58
|
|
|
|
|
91
|
my $value = shift; |
18
|
58
|
|
|
|
|
173
|
return $value; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub uid { |
22
|
2
|
|
|
2
|
1
|
44
|
return $Text::Livedoor::Wiki::scratchpad->{core}{inline_uid}; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
sub opts { |
25
|
15
|
|
|
15
|
1
|
88
|
return $Text::Livedoor::Wiki::opts; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
1; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 NAME |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
Text::Livedoor::Wiki::Plugin::Function - Base Class For Function Plugin |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 DESCRIPTION |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
you can use this class as base to create Function Plugin. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 SYNOPSIS |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
package Text::Livedoor::Wiki::Plugin::Function::Superscript; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
use warnings; |
43
|
|
|
|
|
|
|
use strict; |
44
|
|
|
|
|
|
|
use base qw/Text::Livedoor::Wiki::Plugin::Function/; |
45
|
|
|
|
|
|
|
__PACKAGE__->function_name('sup'); |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub process { |
48
|
|
|
|
|
|
|
my ( $class, $inline, $data ) = @_; |
49
|
|
|
|
|
|
|
my $value = $data->{value}; |
50
|
|
|
|
|
|
|
$value = $inline->parse( $value ); |
51
|
|
|
|
|
|
|
return "$value"; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
&function_name(argument_here){value here} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 FUNCTION |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head2 function_name |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
you can specify your function name. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head2 process |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
you must implement your self . return text what you want for your plugin. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head2 process_mobile |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
if you did not implement this ,then $class->process() is used. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head2 prepare_args |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
you can validate argument with this function. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head2 prepare_value |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
you can validate value with this function. |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head2 uid |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
get unique id |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head2 opts |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
get option hash data |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 AUTHOR |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
polocky |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=cut |