/[Frey]/trunk/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 /trunk/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 130 by dpavlin, Mon Jul 14 23:50:16 2008 UTC
# Line 29  sub html { Line 29  sub html {
29  sub markup {  sub markup {
30          warn "## markup ",dump( @_ );          warn "## markup ",dump( @_ );
31          my ( $self, $class ) = @_;          my ( $self, $class ) = @_;
32            $class ||= $self->class;
33          use Pod::Simple::HTML;          use Pod::Simple::HTML;
34          my $pod = read_file( $self->package_path( $class ) );          my $path = eval { $self->package_path( $class ) };
35            return if $@;
36            my $pod = read_file( $path );
37          my $converter = Pod::Simple::HTML->new();          my $converter = Pod::Simple::HTML->new();
38          my $body;          my $body;
39          my $my_classes = join('|', $self->classes);          my $my_classes = join('|', $self->classes);
# Line 39  sub markup { Line 42  sub markup {
42          $converter->parse_string_document($pod);          $converter->parse_string_document($pod);
43          $body =~ s{.*?<body [^>]+>}{}s;          $body =~ s{.*?<body [^>]+>}{}s;
44          $body =~ s{</body>\s*</html>\s*$}{};          $body =~ s{</body>\s*</html>\s*$}{};
45            $body =~ s!%3A%3A!::!g;
46          $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;
47          $body =~ s!</li>\n\t<ul>!<ul>!;          $body =~ s!</li>\n\t<ul>!<ul>!;
48          $body =~ s!</ul>!</ul></li>!;          $body =~ s!</ul>!</ul></li>!;
49          $body =~ s!<p></p>!!;          $body =~ s!<p></p>!!;
 #       $body =~ s!<a name=!<a id=!g;  
50          $body =~ s!__index__!index!g;          $body =~ s!__index__!index!g;
51          return "<h1>$class</h1>$body";          return $body;
52  }  }
53    
54  1;  1;

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

  ViewVC Help
Powered by ViewVC 1.1.26