| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Apache2::Pod::Text; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Apache2::Pod::Text - mod_perl handler to convert Pod to plain text |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 VERSION |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
Version 0.27 |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=cut |
|
12
|
|
|
|
|
|
|
|
|
13
|
2
|
|
|
2
|
|
4562
|
use strict; |
|
|
2
|
|
|
|
|
6
|
|
|
|
2
|
|
|
|
|
83
|
|
|
14
|
2
|
|
|
2
|
|
21
|
use vars qw( $VERSION ); |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
111
|
|
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
$VERSION = '0.27'; |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
A simple mod_perl handler to easily convert Pod to Text. |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 CONFIGURATION |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
You can replace Apache2::Pod::HTML with Apache2::Pod::Text as your |
|
25
|
|
|
|
|
|
|
C in your apache configuration if you wish to use the |
|
26
|
|
|
|
|
|
|
text rendering of your pod documentation instead of HTML. |
|
27
|
|
|
|
|
|
|
See L for configuration details. |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=cut |
|
30
|
|
|
|
|
|
|
|
|
31
|
2
|
|
|
2
|
|
14
|
use Apache2::Pod; |
|
|
2
|
|
|
|
|
14
|
|
|
|
2
|
|
|
|
|
60
|
|
|
32
|
2
|
|
|
2
|
|
963
|
use Apache2::Const -compile => qw( OK ); |
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
use Pod::Simple::Text; |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub handler { |
|
36
|
|
|
|
|
|
|
my $r = shift; |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
my $str; |
|
39
|
|
|
|
|
|
|
my $file = Apache2::Pod::getpodfile( $r ); |
|
40
|
|
|
|
|
|
|
my $fun = undef; |
|
41
|
|
|
|
|
|
|
my $parser = Pod::Simple::Text->new; |
|
42
|
|
|
|
|
|
|
$parser->complain_stderr(1); |
|
43
|
|
|
|
|
|
|
$parser->output_string( \$str ); |
|
44
|
|
|
|
|
|
|
if ( $file ) { |
|
45
|
|
|
|
|
|
|
if ( $file =~ /^-f<([^>]*)>::(.*)$/ ) { |
|
46
|
|
|
|
|
|
|
$fun = $1; |
|
47
|
|
|
|
|
|
|
$file = $2; |
|
48
|
|
|
|
|
|
|
} |
|
49
|
|
|
|
|
|
|
if ( $fun ) { |
|
50
|
|
|
|
|
|
|
my $document = Apache2::Pod::getpodfuncdoc( $file, $fun ); |
|
51
|
|
|
|
|
|
|
$parser->parse_string_document( $document ); |
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
else { |
|
54
|
|
|
|
|
|
|
$parser->parse_file( $file ); |
|
55
|
|
|
|
|
|
|
} |
|
56
|
|
|
|
|
|
|
} |
|
57
|
|
|
|
|
|
|
else { |
|
58
|
|
|
|
|
|
|
my $modstr = Apache2::Pod::resolve_modname( $r ) || $r->filename || ''; |
|
59
|
|
|
|
|
|
|
my $document = sprintf "=item %1\$s\n\nNo documentation found for \"%1\$s\".\n", $modstr; |
|
60
|
|
|
|
|
|
|
$parser->parse_string_document( $document ); |
|
61
|
|
|
|
|
|
|
} |
|
62
|
|
|
|
|
|
|
$r->content_type('text/plain'); |
|
63
|
|
|
|
|
|
|
$r->print( $str ); |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
return Apache2::Const::OK; |
|
66
|
|
|
|
|
|
|
} |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
L, |
|
71
|
|
|
|
|
|
|
L |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 AUTHOR |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Theron Lewis C<< >> |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 HISTORY |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
Adapteded from Andy Lester's C<< >> Apache::Pod |
|
80
|
|
|
|
|
|
|
package which was adapted from |
|
81
|
|
|
|
|
|
|
Apache2::Perldoc by Rich Bowen C<< >> |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Thanks also to |
|
86
|
|
|
|
|
|
|
Pete Krawczyk, |
|
87
|
|
|
|
|
|
|
Kjetil Skotheim, |
|
88
|
|
|
|
|
|
|
Kate Yoak |
|
89
|
|
|
|
|
|
|
and |
|
90
|
|
|
|
|
|
|
Chris Eade |
|
91
|
|
|
|
|
|
|
for contributions. |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 LICENSE |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
This package is licensed under the same terms as Perl itself. |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=cut |
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
1; |