r7678 - in /trunk/libpod-xhtml-perl: Changes MANIFEST META.yml Makefile.PL README debian/changelog lib/Pod/Hyperlink/ lib/Pod/Xhtml.pm t/01defaults.t t/02links.t t/Pod_Hyperlink_BounceURL.t t/Test_LinkParser.pm t/d.pod t/d.xhtml t/pod_coverage.t

dmn at users.alioth.debian.org dmn at users.alioth.debian.org
Tue Sep 18 04:35:55 UTC 2007


Author: dmn
Date: Tue Sep 18 04:35:54 2007
New Revision: 7678

URL: http://svn.debian.org/wsvn/?sc=1&rev=7678
Log:
* New upstream release

Added:
    trunk/libpod-xhtml-perl/lib/Pod/Hyperlink/
      - copied from r7677, branches/upstream/libpod-xhtml-perl/current/lib/Pod/Hyperlink/
    trunk/libpod-xhtml-perl/t/Pod_Hyperlink_BounceURL.t
      - copied unchanged from r7677, branches/upstream/libpod-xhtml-perl/current/t/Pod_Hyperlink_BounceURL.t
    trunk/libpod-xhtml-perl/t/d.pod
      - copied unchanged from r7677, branches/upstream/libpod-xhtml-perl/current/t/d.pod
    trunk/libpod-xhtml-perl/t/d.xhtml
      - copied unchanged from r7677, branches/upstream/libpod-xhtml-perl/current/t/d.xhtml
Modified:
    trunk/libpod-xhtml-perl/Changes
    trunk/libpod-xhtml-perl/MANIFEST
    trunk/libpod-xhtml-perl/META.yml
    trunk/libpod-xhtml-perl/Makefile.PL
    trunk/libpod-xhtml-perl/README
    trunk/libpod-xhtml-perl/debian/changelog
    trunk/libpod-xhtml-perl/lib/Pod/Xhtml.pm
    trunk/libpod-xhtml-perl/t/01defaults.t
    trunk/libpod-xhtml-perl/t/02links.t
    trunk/libpod-xhtml-perl/t/Test_LinkParser.pm
    trunk/libpod-xhtml-perl/t/pod_coverage.t

Modified: trunk/libpod-xhtml-perl/Changes
URL: http://svn.debian.org/wsvn/trunk/libpod-xhtml-perl/Changes?rev=7678&op=diff
==============================================================================
--- trunk/libpod-xhtml-perl/Changes (original)
+++ trunk/libpod-xhtml-perl/Changes Tue Sep 18 04:35:54 2007
@@ -1,3 +1,10 @@
+Fri May 18 10:42:53 2007 - 1.57
+    * Add dependency to Makefile.PL
+
+Tue May 15 10:50:27 2007 - 1.56
+    * new TopHeading feature contributed by Jonathan Rockway
+    * added support for Pod::Hyperlink::BounceURL link parser
+
 Wed Jul 12 13:08:01 2006 - 1.52
     * generated markup now handles lists in index (via MakeIndex => 2) correctly
     * all head section content is enclosed within a <div> with an id attribute
@@ -7,8 +14,6 @@
 
 Thu Apr 13 11:09:33 2006 - 1.51
     Updated misc. unit tests to reflect new output formatting.
-
-Thu Apr 13 10:58:39 2006 - 1.51
     Generation of definition lists now using single <dd> for each <dt> and various block level elements within.
     Generated XHTML standards compliant.
 
@@ -39,8 +44,7 @@
 
 Wed Apr 27 14:58:54 2005 - 1.37
 	- Add DOCTYPE (XHTML 1.0 Transitional) (Thanks to Brian Cassidy)
-	- Fix XHTML validity - some of the list types were incorrectly nested
-	  (Brian Cassidy)
+	- Fix XHTML validity - some of the list types were incorrectly nested (Brian Cassidy)
 	- Fix index listing - nested lists must be in an <li> (Brian Cassidy)
 	- Fixed index generation - it no longer creates empty lists
 	- Add content-wrapper <divs> (pod & toc, like search.cpan) (Brian Cassidy)

Modified: trunk/libpod-xhtml-perl/MANIFEST
URL: http://svn.debian.org/wsvn/trunk/libpod-xhtml-perl/MANIFEST?rev=7678&op=diff
==============================================================================
--- trunk/libpod-xhtml-perl/MANIFEST (original)
+++ trunk/libpod-xhtml-perl/MANIFEST Tue Sep 18 04:35:54 2007
@@ -5,6 +5,7 @@
 MANIFEST.SKIP
 README
 lib/Pod/Xhtml.pm
+lib/Pod/Hyperlink/BounceURL.pm
 scripts/pod2xhtml
 cgi-bin/pod2xhtml.pl
 t/Test_LinkParser.pm
@@ -15,7 +16,10 @@
 t/b.xhtml
 t/c.pod
 t/c.xhtml
+t/d.pod
+t/d.xhtml
 t/02links.t
 t/pod_coverage.t
+t/Pod_Hyperlink_BounceURL.t
 t/pod.t
 META.yml                                 Module meta-data (added by MakeMaker)

Modified: trunk/libpod-xhtml-perl/META.yml
URL: http://svn.debian.org/wsvn/trunk/libpod-xhtml-perl/META.yml?rev=7678&op=diff
==============================================================================
--- trunk/libpod-xhtml-perl/META.yml (original)
+++ trunk/libpod-xhtml-perl/META.yml Tue Sep 18 04:35:54 2007
@@ -1,12 +1,13 @@
 # http://module-build.sourceforge.net/META-spec.html
 #XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
 name:         Pod-Xhtml
-version:      1.52
+version:      1.57
 version_from: lib/Pod/Xhtml.pm
 installdirs:  site
 requires:
     Pod::Parser:                   0
     Pod::ParseUtils:               0
+    Test::Assertions::TestScript:  0
     Test::More:                    0
 
 distribution_type: module

Modified: trunk/libpod-xhtml-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/trunk/libpod-xhtml-perl/Makefile.PL?rev=7678&op=diff
==============================================================================
--- trunk/libpod-xhtml-perl/Makefile.PL (original)
+++ trunk/libpod-xhtml-perl/Makefile.PL Tue Sep 18 04:35:54 2007
@@ -8,6 +8,7 @@
                             Pod::Parser => 0,
                             Pod::ParseUtils => 0,
                             Test::More => 0,
+                            Test::Assertions::TestScript => 0,
                            },
               ABSTRACT_FROM => 'lib/Pod/Xhtml.pm',
               AUTHOR        => 'British Broadcasting Corporation',

Modified: trunk/libpod-xhtml-perl/README
URL: http://svn.debian.org/wsvn/trunk/libpod-xhtml-perl/README?rev=7678&op=diff
==============================================================================
--- trunk/libpod-xhtml-perl/README (original)
+++ trunk/libpod-xhtml-perl/README Tue Sep 18 04:35:54 2007
@@ -1,4 +1,4 @@
-Pod::Xhtml v1.52
+Pod::Xhtml v1.57
 
 (c) BBC 2004. This program is free software; you can redistribute it and/or
 modify it under the GNU GPL.

Modified: trunk/libpod-xhtml-perl/debian/changelog
URL: http://svn.debian.org/wsvn/trunk/libpod-xhtml-perl/debian/changelog?rev=7678&op=diff
==============================================================================
--- trunk/libpod-xhtml-perl/debian/changelog (original)
+++ trunk/libpod-xhtml-perl/debian/changelog Tue Sep 18 04:35:54 2007
@@ -1,3 +1,9 @@
+libpod-xhtml-perl (1.57-1) UNRELEASED; urgency=low
+
+  * New upstream release
+
+ -- Damyan Ivanov <dmn at debian.org>  Tue, 18 Sep 2007 07:35:43 +0300
+
 libpod-xhtml-perl (1.52-2) unstable; urgency=low
 
   [ gregor herrmann ]

Modified: trunk/libpod-xhtml-perl/lib/Pod/Xhtml.pm
URL: http://svn.debian.org/wsvn/trunk/libpod-xhtml-perl/lib/Pod/Xhtml.pm?rev=7678&op=diff
==============================================================================
--- trunk/libpod-xhtml-perl/lib/Pod/Xhtml.pm (original)
+++ trunk/libpod-xhtml-perl/lib/Pod/Xhtml.pm Tue Sep 18 04:35:54 2007
@@ -3,13 +3,14 @@
 use strict;
 use Pod::Parser;
 use Pod::ParseUtils;
+use Carp;
 use vars qw/@ISA %COMMANDS %SEQ $VERSION $FirstAnchorId $ContentSuffix/;
 
 $FirstAnchorId = "TOP";
 $ContentSuffix = "-CONTENT";
 
 @ISA = qw(Pod::Parser);
-($VERSION) = ('$Revision: 1.52 $' =~ m/([\d\.]+)/);
+($VERSION) = ('$Revision: 1.57 $' =~ m/([\d\.]+)/);
 
 # recognized commands
 %COMMANDS = map { $_ => 1 } qw(pod head1 head2 head3 head4 item over back for begin end);
@@ -59,6 +60,9 @@
 	$self->{FragmentOnly} = 0 unless defined $self->{FragmentOnly};
 	$self->{HeadText} = $self->{BodyOpenText} = $self->{BodyCloseText} = '';
 	$self->{LinkParser} ||= new Pod::Hyperlink;
+	$self->{TopHeading} ||= 1;
+	$self->{TopHeading} = int $self->{TopHeading}; # heading level must be an integer
+	croak "TopHeading must be greater than zero" if $self->{TopHeading} < 1; # (prevent negative heading levels)
 	$self->SUPER::initialize();
 }
 
@@ -197,13 +201,16 @@
 	for ($command) {
 		my $data_para = @{$self->{dataSections}}; # inside a data paragraph?
 		/^head1/ && !$data_para && do {
+			my $top_heading = 'h'. $self->{TopHeading};
+			$top_heading = 'h1' if !$self->{FragmentOnly}; # ignore TopHeading when not in fragment mode
+
 			# if ANY sections are open then close the previously opened div
 			$self->{buffer} .= "\n</div>\n" unless ( @{ $self->{sections} } == 1 );
 			
 			$anchor = $self->_addSection( 'head1', $paragraph );
 			my $anchorContent = $self->_addSection( '', $paragraph . $ContentSuffix);
-
-			$self->{buffer} .= qq(<h1 id="$anchor">$paragraph</h1>)
+			
+			$self->{buffer} .= qq(<$top_heading id="$anchor">$paragraph</$top_heading>)
 					.($self->{TopLinks} ? $self->{TopLinks} : '')."\n"
 					."<div id=\"$anchorContent\">\n";
 
@@ -212,7 +219,10 @@
 		};
 		/^head([234])/ && !$data_para && do {
 			my $head_level = $1;
-
+			if($self->{FragmentOnly}){
+				$head_level += ($self->{TopHeading} - 1);
+				$head_level = 6 if $head_level > 6;
+			}
 			# if ANY sections are open then close the previously opened div
 			$self->{buffer} .= "\n</div>\n" unless ( @{ $self->{sections} } == 1 );
 
@@ -228,7 +238,7 @@
 				last;
 			}
 
-			$self->{listHasItems}[-1] = 1;
+			$self->{listHasItems}[-1]++;
 			$self->{listCurrentParas}[-1] = 0;
 
 			# is this the first item in the list?
@@ -291,10 +301,11 @@
 			push @{$self->{listCurrentParas}}, 0;
 		};
 		/^back/ && !$data_para && do {
+			my $listItems = pop @{$self->{listHasItems}};
 			if (--$self->{inList} < 0) {
 				warn "=back commands don't balance =overs at $self->{_INFILE} line $line\n";
 				last;
-			} elsif ($self->{listHasItems} == 0) {
+			} elsif ($listItems == 0) {
 				warn "empty list at $self->{_INFILE} line $line\n";
 				last;
 			} elsif (@{$self->{listKind}} && $self->{listKind}[-1] == 1) {
@@ -344,7 +355,6 @@
 				}
 			}
 
-			pop @{$self->{listHasItems}};
 			pop @{$self->{listKind}};
 			pop @{$self->{listCurrentParas}};
 			last;
@@ -634,6 +644,17 @@
 		my $targ = $self->{LinkParser}->node;
 		my $text = $self->{LinkParser}->text;
 		$string = qq(<a href="$targ">$text</a>);
+	} elsif ($kind =~ m/^bounceurl:(.+)$/) {
+		# Our link-parser has decided that the link should be handled by a particular URL
+		my $url = $1;
+		$url = _htmlEscape( $url ); # since the URL may contain ampersands
+		$string = $self->{LinkParser}->markup;
+		if ($string =~ m/P<.+>/) {	# when there's no alternative text we get P, and maybe Q
+			$string =~ s|Q<(.+?)>|<strong class="pod_xhtml_bounce_url_text">$1</strong>|;
+			$string =~ s|P<(.+?)>|<a class="pod_xhtml_bounce_url" href="$url">$1</a>|;
+		} else {
+			$string =~ s|Q<(.+?)>|<a class="pod_xhtml_bounce_url" href="$url">$1</a>|;
+		}
 	} elsif ($page eq '') {	# a link to this page
 		# Post-process these links so we can things up to the correct sections
 		my $targ = $self->{LinkParser}->node;
@@ -797,6 +818,21 @@
 server-side include etc). There is no HEAD element nor any BODY or HTML
 tags. Any text added with the add*Text methods will B<not> be output.
 
+
+=item TopHeading
+
+Allows you to set the starting heading level when in fragment mode.
+For example, if your document already has h1 tags and you want the
+generated POD to nest inside the outline, you can specify
+
+	TopHeading => 2
+
+and C<=head1> will be tagged with h2 tags, C<=head3> with h3, and so
+on.
+
+Note that XHTML doesn't allow for heading tags past h6, so h7 and up
+will be translated to h6 as necessary.
+
 =item TopLinks
 
 At each section head this text is added to provide a link back to the top.
@@ -809,6 +845,10 @@
 An object that parses links in the POD document. By default, this is a regular
 Pod::Hyperlink object. Any user-supplied link parser must conform the the
 Pod::Hyperlink API.
+
+This module works with a L<Pod::Hyperlink::BounceURL> link parser and generates
+hyperlinks as 'a' elements with a class of 'pod_xhtml_bounce_url'. The optional
+text giving the "node" is enclosed in a 'strong' element with a class of 'pod_xhtml_bounce_url_text'
 
 =back
 

Modified: trunk/libpod-xhtml-perl/t/01defaults.t
URL: http://svn.debian.org/wsvn/trunk/libpod-xhtml-perl/t/01defaults.t?rev=7678&op=diff
==============================================================================
--- trunk/libpod-xhtml-perl/t/01defaults.t (original)
+++ trunk/libpod-xhtml-perl/t/01defaults.t Tue Sep 18 04:35:54 2007
@@ -1,5 +1,5 @@
-#!/usr/bin/perl -w
-#$Id: 01defaults.t,v 1.21 2006/07/12 12:00:39 mattheww Exp $
+#!/usr/local/bin/perl -w
+#$Id: 01defaults.t,v 1.23 2006/08/29 12:48:10 andreww Exp $
 
 use strict;
 use lib qw(./lib ../lib);

Modified: trunk/libpod-xhtml-perl/t/02links.t
URL: http://svn.debian.org/wsvn/trunk/libpod-xhtml-perl/t/02links.t?rev=7678&op=diff
==============================================================================
--- trunk/libpod-xhtml-perl/t/02links.t (original)
+++ trunk/libpod-xhtml-perl/t/02links.t Tue Sep 18 04:35:54 2007
@@ -1,5 +1,5 @@
-#!/usr/bin/perl -w
-#$Id: 02links.t,v 1.7 2006/04/13 10:10:39 mattheww Exp $
+#!/usr/local/bin/perl -w
+#$Id: 02links.t,v 1.9 2006/08/29 12:48:11 andreww Exp $
 
 use strict;
 use lib qw(./lib ../lib);

Modified: trunk/libpod-xhtml-perl/t/Test_LinkParser.pm
URL: http://svn.debian.org/wsvn/trunk/libpod-xhtml-perl/t/Test_LinkParser.pm?rev=7678&op=diff
==============================================================================
--- trunk/libpod-xhtml-perl/t/Test_LinkParser.pm (original)
+++ trunk/libpod-xhtml-perl/t/Test_LinkParser.pm Tue Sep 18 04:35:54 2007
@@ -1,10 +1,10 @@
-#$Id: Test_LinkParser.pm,v 1.4 2004/10/22 09:42:41 piersk Exp $
+#$Revision: 1.5 $
 package Test_LinkParser;
 use Pod::ParseUtils;
 use strict;
 use vars '@ISA', '$VERSION';
 @ISA = 'Pod::Hyperlink';
-$VERSION = ('$Revision: 1.4 $' =~ /([\d\.]+)/)[0];
+$VERSION = ('$Revision: 1.5 $' =~ /([\d\.]+)/)[0];
 
 # Override Pod::Hyperlink for the unit tests since different versions behave
 # differently WRT decorating links (e.g. '... elsewhere in this document')

Modified: trunk/libpod-xhtml-perl/t/pod_coverage.t
URL: http://svn.debian.org/wsvn/trunk/libpod-xhtml-perl/t/pod_coverage.t?rev=7678&op=diff
==============================================================================
--- trunk/libpod-xhtml-perl/t/pod_coverage.t (original)
+++ trunk/libpod-xhtml-perl/t/pod_coverage.t Tue Sep 18 04:35:54 2007
@@ -1,5 +1,5 @@
-#!/usr/bin/perl -w
-#$Id: pod_coverage.t,v 1.2 2005/07/15 10:27:23 simonf Exp $
+#!/usr/local/bin/perl -w
+#$Id: pod_coverage.t,v 1.3 2006/08/29 12:48:11 andreww Exp $
 use Test::More;
 eval "use Test::Pod::Coverage 1.00";
 plan skip_all => "Test::Pod::Coverage 1.00 required for testing POD Coverage" if $@;




More information about the Pkg-perl-cvs-commits mailing list