Apache::Pod - base class for converting Pod files to prettier forms


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

Index


Code Index:

NAME

Top

Apache::Pod - base class for converting Pod files to prettier forms

VERSION

Top

Version 0.22

SYNOPSIS

Top

The Apache::Pod::* are mod_perl handlers to easily convert Pod to HTML or other forms. You can also emulate perldoc.

CONFIGURATION

Top

All configuration is done in one of the subclasses.

TODO

Top

I could envision a day when the user can specify which output format he'd like from the URL, such as

    http://your.server/perldoc/f/printf?rtf

FUNCTIONS

Top

No functions are exported. I don't want to dink around with Exporter in mod_perl if I don't need to.

getpodfile( $r )

Returns the filename requested off of the $r request object, or what Perldoc would find, based on Pod::Find.

AUTHOR

Top

Andy Lester <andy at petdance.com>

ACKNOWLEDGEMENTS

Top

Adapted from Apache::Perldoc by Rich Bowen. Thanks also to Pete Krawczyk, Kjetil Skotheim, Kate Yoak and Chris Eade for contributions.

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;

use vars qw( $VERSION );
use strict;

$VERSION = '0.22';

use Pod::Find;

sub getpodfile {
    my $r = shift;

    my $filename;

    if ($r->filename =~ m/\.pod$/i) {
        $filename = $r->filename;
    } else {
        my $module = $r->path_info;
        $module =~ s|/||;
        $module =~ s|/|::|g;
        $module =~ s|\.html?$||;  # Intermodule links end with .html

        $filename = Pod::Find::pod_where( {-inc=>1}, $module );

        # XXX Unimplemented
        # $pod =~ s/^f::/-f /;    # If we specify /f/ as our "base", it's a function search
    }

    return $filename;
}

1;