Subject: | [PATCH] AnnoCPAN::PerlDoc support |
The attached patch adds support for AnnoCPAN comments in local POD.
This is accomplished via a local mirror of the annocpan.org SQLite
database. I've also attached a screenshot of what the HTML looks like
with this patch.
This patch lacks documentation, unfortunately. If the concept is
approved, I would be willing to contribute some of that documentation.
For more info, see:
http://search.cpan.org/dist/AnnoCPAN-Perldoc/
and optionally:
http://search.cpan.org/dist/AnnoCPAN-Perldoc-SyncDB/
(the latter was written by me)
Subject: | annocpan.patch |
--- /Users/chris/perl/lib/perl5/site_perl/Pod/POM/Web.pm 2007-04-24 15:16:17.000000000 -0500
+++ lib/Pod/POM/Web.pm 2007-04-26 20:40:49.000000000 -0500
@@ -32,6 +32,9 @@
my $no_indexer = eval {require Pod::POM::Web::Indexer} ? 0 : $@;
+my @podfilters = (
+ eval {require AnnoCPAN::Perldoc::Filter} ? sub {AnnoCPAN::Perldoc::Filter->new->filter(@_)} : (),
+);
#----------------------------------------------------------------------
@@ -252,6 +255,8 @@
: $self->parse_version($content);
$version &&= " <small>$version</small>";
+ $content = $_->($content) for @podfilters;
+
# Pod::POM fails to parse correctly when there is an initial blank line
$content =~ s/^\s*//;
@@ -877,6 +892,20 @@
}
+sub view_over {
+ my ($self, $over) = @_;
+ # This is a fix for AnnoCPAN POD which routinely has
+ # =over \n =over \n ... \n =back \n =back
+ my $content = $self->SUPER::view_over($over);
+ if ($content eq "") {
+ my $overs = $over->over();
+ if (@$overs) {
+ return join q{}, '<blockquote>', (map {$self->view_over($_)} @$overs), '</blockquote>';
+ }
+ }
+ return $content;
+}
+
sub view_item {
my ($self, $item) = @_;
Subject: | annocpan.png |