Apache::Pod::Text - mod_perl handler to convert Pod to plain text


Apache-Pod documentation Contained in the Apache-Pod distribution.

Index


Code Index:

NAME

Top

Apache::Pod::Text - mod_perl handler to convert Pod to plain text

VERSION

Top

Version 0.22

SYNOPSIS

Top

A simple mod_perl handler to easily convert Pod to Text.

CONFIGURATION

Top

See Apache::Pod::HTML for configuration details.

AUTHOR

Top

Andy Lester <andy@petdance.com>, adapted from Apache::Perldoc by Rich Bowen <rbowen@ApacheAdmin.com>

LICENSE

Top

This package is licensed under the same terms as Perl itself.


Apache-Pod documentation Contained in the Apache-Pod distribution.
package Apache::Pod::Text;

use strict;
use vars qw( $VERSION );

$VERSION = '0.22';

use Apache::Pod;
use Apache::Constants;
use Pod::Simple::Text;

sub handler {
    my $r = shift;

    my $str;
    my $file = Apache::Pod::getpod( $r );

    my $parser = Pod::Simple::Text->new;
    $parser->complain_stderr(1);
    $parser->output_string( \$str );
    $parser->parse_file( $file );

    $r->content_type('text/plain');
    $r->send_http_header;
    $r->print( $str );

    return OK;
}

1;