diff options
author | Fred Drake <fdrake@acm.org> | 1998-03-27 05:24:53 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 1998-03-27 05:24:53 (GMT) |
commit | 19e2ce58bf98640e8fdf009bbb2edef2ce1236ef (patch) | |
tree | afaa39aab79ad0416018559f514a5b504840643e /Doc/tools | |
parent | 48a16bf6b503145a07d3519b436532c9fef3f24f (diff) | |
download | cpython-19e2ce58bf98640e8fdf009bbb2edef2ce1236ef.zip cpython-19e2ce58bf98640e8fdf009bbb2edef2ce1236ef.tar.gz cpython-19e2ce58bf98640e8fdf009bbb2edef2ce1236ef.tar.bz2 |
Add support for mapping internal labels used from the index.
Diffstat (limited to 'Doc/tools')
-rwxr-xr-x | Doc/tools/node2label.pl | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/Doc/tools/node2label.pl b/Doc/tools/node2label.pl index 3e4f8f0..5cc54d6 100755 --- a/Doc/tools/node2label.pl +++ b/Doc/tools/node2label.pl @@ -15,22 +15,33 @@ foreach $label (sort keys %external_labels) { $nodes{$key} = $label; } +# This adds the "internal" labels added for indexing. These labels will not +# be used for file names. +require "intlabels.pl"; +foreach $label (keys %internal_labels) { + $key = $internal_labels{$label}; + $key =~ s|^/||; + if (defined($nodes{$key})) { + $nodes{$label} = $nodes{$key}; + } +} + # collect labels that have been used %newnames = (); while (<>) { # don't want to do one s/// per line per node # so look for lines with hrefs, then do s/// on nodes present - if (/HREF=\"([^\#\"]*)html[\#\"]/) { - @parts = split(/HREF\=\"/); + if (/(HREF|href)=\"([^\#\"]*)html[\#\"]/) { + @parts = split(/(HREF|href)\=\"/); shift @parts; for $node (@parts) { $node =~ s/[\#\"].*$//g; chop($node); if (defined($nodes{$node})) { $label = $nodes{$node}; - if (s/HREF=\"$node([\#\"])/HREF=\"$label.html$1/g) { - s/HREF=\"$label.html#SECTION\d+/HREF=\"$label.html/g; + if (s/(HREF|href)=\"$node([\#\"])/$1=\"$label.html$2/g) { + s/(HREF|href)=\"$label.html#(l2h-)?SECTION\d+/$1=\"$label.html/g; $newnames{$node} = "$label.html"; } } |