From 0bd1c35ee47dab181543ba366fe021122c591f65 Mon Sep 17 00:00:00 2001 From: Zefram Date: Thu, 14 Dec 2017 02:27:28 +0000 Subject: fix links in generated HTML documentation Invoke installhtml in the right way for it to generate relative links. Fix installhtml's code for creating relative links in the index for split documents. Update Pod::Html's section name transformer to match the actual output seen via Pod::Simple::XHTML. Incidentally update split-on-head code for the new style of HTML generated by Pod::Simple::XHTML. Fixes [perl #110056]. --- installhtml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'installhtml') diff --git a/installhtml b/installhtml index 1b724c0c41..62e92fc806 100644 --- a/installhtml +++ b/installhtml @@ -7,7 +7,7 @@ use Config; # for config options in the makefile use File::Spec::Functions qw(rel2abs no_upwards); use Getopt::Long; # for command-line parsing use Cwd; -use Pod::Html 'anchorify'; +use Pod::Html 1.23 qw(anchorify relativize_url); =head1 NAME @@ -240,10 +240,10 @@ foreach my $dir (@splithead) { $/ = ""; my @data = (); while () { - last if /name="name"/i; + last if m!

NAME

!; $_ =~ s{href="#(.*)">}{ - my $url = "$pod/$1.html" ; - $url = Pod::Html::relativize_url( $url, "$file.html" ) + my $url = "$file/@{[anchorify(qq($1))]}.html" ; + $url = relativize_url( $url, "$file.html" ) if ( ! defined $Options{htmlroot} || $Options{htmlroot} eq '' ); "href=\"$url\">" ; }egi; @@ -254,7 +254,7 @@ foreach my $dir (@splithead) { # now rewrite the file open(H, '>', "$file.html") || die "$0: error opening $file.html for output: $!\n"; - print H "@data", "\n"; + print H @data, "\n\n\n\n\n"; close(H); } @@ -321,9 +321,9 @@ sub create_index { m#

NAME

\s*

\s*(\S+)\s+-\s+(\S.*?\S)

#); defined $lcp1 or die "$0: can't find NAME section in $dir/$file\n"; - my $url= "$pod/$file" ; + my $url= "$dir/$file" ; if ( ! defined $Options{htmlroot} || $Options{htmlroot} eq '' ) { - $url = Pod::Html::relativize_url( "$pod/$file", $html ) ; + $url = relativize_url( $url, $html ) ; } print HTML qq(
); -- cgit v1.2.1