[svn:parrot] r48112 - branches/html_cleanup/lib/Parrot/Docs

coke at svn.parrot.org coke at svn.parrot.org
Mon Jul 19 17:06:22 UTC 2010


Author: coke
Date: Mon Jul 19 17:06:22 2010
New Revision: 48112
URL: https://trac.parrot.org/parrot/changeset/48112

Log:
Default title to what POD::Simple::HTML thinks the title is.
Massage slightly to match current output of 2.5.0's 'make html'

Modified:
   branches/html_cleanup/lib/Parrot/Docs/PodToHtml.pm

Modified: branches/html_cleanup/lib/Parrot/Docs/PodToHtml.pm
==============================================================================
--- branches/html_cleanup/lib/Parrot/Docs/PodToHtml.pm	Mon Jul 19 16:38:22 2010	(r48111)
+++ branches/html_cleanup/lib/Parrot/Docs/PodToHtml.pm	Mon Jul 19 17:06:22 2010	(r48112)
@@ -74,9 +74,17 @@
     $self->{RESOURCES_URL} = '' unless $self->{RESOURCES_URL};
     $self->{NAV_BAR}       = '' unless $self->{NAV_BAR};
 
-    my $title = $self->{'Title'};
-    esc($title);
-
+    my $title = esc($self->get_title());
+    # If the name of the document is IN the document title (a common pod
+    # idiom), strip it out.
+
+    if ($title =~ m/(.*?)-/) {
+        # assume it's a filename if it has a dot in it.
+        if ($1 =~ m/\./) {
+            $title =~ s/^.*?-\s*//;
+        }
+    }
+ 
     my $dirCount = ( $self->{source_filename} =~ tr{/}{/} );
     my $resources_URL = join('/', (('..') x ++$dirCount)) . '/resources';
 


More information about the parrot-commits mailing list