/[Frey]/branches/no-pager/lib/Frey/Pod.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /branches/no-pager/lib/Frey/Pod.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 126 by dpavlin, Mon Jul 14 23:12:48 2008 UTC revision 136 by dpavlin, Tue Jul 15 17:14:33 2008 UTC
# Line 27  sub html { Line 27  sub html {
27  }  }
28    
29  sub markup {  sub markup {
         warn "## markup ",dump( @_ );  
30          my ( $self, $class ) = @_;          my ( $self, $class ) = @_;
31            $class ||= $self->class;
32          use Pod::Simple::HTML;          use Pod::Simple::HTML;
33          my $pod = read_file( $self->package_path( $class ) );          my $path = eval { $self->package_path( $class ) };
34            return if $@;
35            my $pod = read_file( $path );
36          my $converter = Pod::Simple::HTML->new();          my $converter = Pod::Simple::HTML->new();
37          my $body;          my $body;
38          my $my_classes = join('|', $self->classes);          my $my_classes = join('|', $self->classes);
         warn "my_classes: $my_classes";  
39          $converter->output_string( \$body );          $converter->output_string( \$body );
40          $converter->parse_string_document($pod);          $converter->parse_string_document($pod);
41          $body =~ s{.*?<body [^>]+>}{}s;          $body =~ s{.*?<body [^>]+>}{}s;
42          $body =~ s{</body>\s*</html>\s*$}{};          $body =~ s{</body>\s*</html>\s*$}{};
43            $body =~ s!%3A%3A!::!g;
44          $body =~ s{<a href="http://search\.cpan\.org/perldoc\?($my_classes)"([^>]*)>}{<a href="/pod/$1"$2>}g;          $body =~ s{<a href="http://search\.cpan\.org/perldoc\?($my_classes)"([^>]*)>}{<a href="/pod/$1"$2>}g;
45          $body =~ s!</li>\n\t<ul>!<ul>!;          $body =~ s!</li>\n\t<ul>!<ul>!;
46          $body =~ s!</ul>!</ul></li>!;          $body =~ s!</ul>!</ul></li>!;
47          $body =~ s!<p></p>!!;          $body =~ s!<p></p>!!;
 #       $body =~ s!<a name=!<a id=!g;  
48          $body =~ s!__index__!index!g;          $body =~ s!__index__!index!g;
49          return "<h1>$class</h1>$body";          return $body;
50  }  }
51    
52  1;  1;

Legend:
Removed from v.126  
changed lines
  Added in v.136

  ViewVC Help
Powered by ViewVC 1.1.26