Skip to content

Commit 5219d14

Browse files
author
H. Peter Anvin
committed
doc: don't include "chapter", "section" etc in the HTML index
The use of statements like "chapter", "section" and so on makes the HTML index insanely verbose. Remove them; they don't add any information. Signed-off-by: H. Peter Anvin <[email protected]>
1 parent beabb3c commit 5219d14

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

doc/rdsrc.pl

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,10 +1024,17 @@ sub html_index {
10241024
push @a, "n :";
10251025
$sep = 0;
10261026
foreach $node (@nodes) {
1027-
next if !$idxnodes{$node,$itag};
1028-
push @a, "n ," if $sep;
1029-
push @a, "sp", "x $xrefnodes{$node}", "n $node", "xe$xrefnodes{$node}";
1030-
$sep = 1;
1027+
next if !$idxnodes{$node,$itag};
1028+
my $xn = $xrefnodes{$node};
1029+
my $nn = $node;
1030+
1031+
# Text like "chapter", "appendix", "section", etc in the index
1032+
# makes it unnecessarily wide
1033+
$nn =~ s/^.*\s+//g; # Remove all but the actual index information
1034+
1035+
push @a, "n ," if $sep;
1036+
push @a, "sp", "x $xn", "n $nn", "xe$xn";
1037+
$sep = 1;
10311038
}
10321039
print "<li class=\"index\">\n";
10331040
$line = '';

0 commit comments

Comments
 (0)