line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Template::Plugin::Trac; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
############################################################################### |
4
|
|
|
|
|
|
|
# Required inclusions. |
5
|
|
|
|
|
|
|
############################################################################### |
6
|
1
|
|
|
1
|
|
102454
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
33
|
|
7
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
31
|
|
8
|
1
|
|
|
1
|
|
6
|
use Text::Trac; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11
|
|
9
|
1
|
|
|
1
|
|
43
|
use base qw(Template::Plugin::Filter); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
555
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
############################################################################### |
12
|
|
|
|
|
|
|
# Version number. |
13
|
|
|
|
|
|
|
############################################################################### |
14
|
|
|
|
|
|
|
our $VERSION = '1.03'; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
############################################################################### |
17
|
|
|
|
|
|
|
# Subroutine: init() |
18
|
|
|
|
|
|
|
############################################################################### |
19
|
|
|
|
|
|
|
# Initializes the template plugin. |
20
|
|
|
|
|
|
|
############################################################################### |
21
|
|
|
|
|
|
|
sub init { |
22
|
4
|
|
|
4
|
1
|
156423
|
my $self = shift; |
23
|
4
|
|
|
|
|
16
|
$self->{'_DYNAMIC'} = 1; |
24
|
4
|
|
50
|
|
|
42
|
$self->install_filter( $self->{'_ARGS'}->[0] || 'trac' ); |
25
|
4
|
|
|
|
|
240
|
return $self; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
############################################################################### |
29
|
|
|
|
|
|
|
# Subroutine: filter($txt, $args, $config) |
30
|
|
|
|
|
|
|
############################################################################### |
31
|
|
|
|
|
|
|
# Filters the given text, by running it through 'Text::Trac'. |
32
|
|
|
|
|
|
|
############################################################################### |
33
|
|
|
|
|
|
|
sub filter { |
34
|
4
|
|
|
4
|
1
|
564
|
my ($self, $text, $args, $config) = @_; |
35
|
4
|
|
|
|
|
9
|
my $parser = Text::Trac->new( %{$config} ); |
|
4
|
|
|
|
|
26
|
|
36
|
4
|
|
|
|
|
66
|
return $parser->parse( $text ); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=for stopwords WikiFormatting |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 NAME |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Template::Plugin::Trac - Template::Toolkit filter for Text::Trac |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 SYNOPSIS |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
[% USE Trac %] |
50
|
|
|
|
|
|
|
... |
51
|
|
|
|
|
|
|
[% FILTER trac %] |
52
|
|
|
|
|
|
|
= Heading One = |
53
|
|
|
|
|
|
|
== Heading Two == |
54
|
|
|
|
|
|
|
[% END %] |
55
|
|
|
|
|
|
|
... |
56
|
|
|
|
|
|
|
[% text | trac %] |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 DESCRIPTION |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
C is a plugin for C, which formats |
61
|
|
|
|
|
|
|
your text using Trac's WikiFormatting style. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 METHODS |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=over |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=item init() |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Initializes the template plugin. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=item filter($txt, $args, $config) |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Filters the given text, by running it through C. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=back |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 AUTHOR |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
Graham TerMarsch |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 COPYRIGHT |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Copyright (C) 2006-2007, Graham TerMarsch. All rights Reserved. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under the same |
86
|
|
|
|
|
|
|
terms as Perl itself. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 SEE ALSO |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=over |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=item L |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=item L |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=back |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=cut |