--- trunk/lib/Frey/Pod.pm 2008/07/14 23:12:48 126 +++ branches/no-pager/lib/Frey/Pod.pm 2008/12/03 21:12:43 702 @@ -18,34 +18,32 @@ use File::Slurp; use Data::Dump qw/dump/; +use Pod::Find qw/pod_where/; -sub html { - my ( $self, $req ) = @_; - my $f = { $req->params }; - my $class = delete( $f->{class} ) || $self->class; - $req->print( $self->page( title => $class, body => $self->markup( $class ) ) ); -} - -sub markup { - warn "## markup ",dump( @_ ); - my ( $self, $class ) = @_; +sub as_markup { + my $self = shift; + my $class = $self->class; use Pod::Simple::HTML; - my $pod = read_file( $self->package_path( $class ) ); + my $path = pod_where( { -inc => 1 }, $class ); + return $self->error( "Can't find pod for $class\n" ) unless $path; + my $pod = read_file( $path ); my $converter = Pod::Simple::HTML->new(); my $body; my $my_classes = join('|', $self->classes); - warn "my_classes: $my_classes"; $converter->output_string( \$body ); $converter->parse_string_document($pod); $body =~ s{.*?]+>}{}s; $body =~ s{\s*\s*$}{}; - $body =~ s{]*)>}{}g; + $body =~ s!%3A%3A!::!g; +# $body =~ s{]*)>}{}g; + $body =~ s{]*)>([^<]+)<([^>]+)>}{$4<$5>◊<$5>}g; $body =~ s!\n\t!; $body =~ s!

!!; -# $body =~ s!
$class$body"; + $self->title( $class ); + return $body; + } 1;