summaryrefslogtreecommitdiff
path: root/installhtml
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2017-12-14 02:27:28 +0000
committerZefram <zefram@fysh.org>2017-12-14 02:44:34 +0000
commit0bd1c35ee47dab181543ba366fe021122c591f65 (patch)
tree018da7d41d7b7da2cc9f9f34502942fb133d4c2c /installhtml
parent59eb8be1443b97df4c7886794cd12918a376321a (diff)
downloadperl-0bd1c35ee47dab181543ba366fe021122c591f65.tar.gz
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].
Diffstat (limited to 'installhtml')
-rw-r--r--installhtml14
1 files changed, 7 insertions, 7 deletions
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 (<H>) {
- last if /name="name"/i;
+ last if m!<h1 id="NAME">NAME</h1>!;
$_ =~ 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, "</body>\n\n</html>\n\n\n";
close(H);
}
@@ -321,9 +321,9 @@ sub create_index {
m#<h1 id="NAME">NAME</h1>\s*<p>\s*(\S+)\s+-\s+(\S.*?\S)</p>#);
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(<DT><A HREF="$url">);