[nasm:master] doc: don't include "chapter", "section" etc in the HTML index

nasm-bot for H. Peter Anvin hpa at zytor.com
Wed Nov 9 19:06:04 PST 2022


Commit-ID:  5219d14e6ff4ff48109cf862fc12a6af0762e26d
Gitweb:     http://repo.or.cz/w/nasm.git?a=commitdiff;h=5219d14e6ff4ff48109cf862fc12a6af0762e26d
Author:     H. Peter Anvin <hpa at zytor.com>
AuthorDate: Wed, 9 Nov 2022 19:02:56 -0800
Committer:  H. Peter Anvin <hpa at zytor.com>
CommitDate: Wed, 9 Nov 2022 19:02:56 -0800

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 <hpa at zytor.com>


---
 doc/rdsrc.pl | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/doc/rdsrc.pl b/doc/rdsrc.pl
index f0d570e7..53353862 100644
--- a/doc/rdsrc.pl
+++ b/doc/rdsrc.pl
@@ -1024,10 +1024,17 @@ sub html_index {
     push @a, "n :";
     $sep = 0;
     foreach $node (@nodes) {
-      next if !$idxnodes{$node,$itag};
-      push @a, "n ," if $sep;
-      push @a, "sp", "x $xrefnodes{$node}", "n $node", "xe$xrefnodes{$node}";
-      $sep = 1;
+	next if !$idxnodes{$node,$itag};
+	my $xn = $xrefnodes{$node};
+	my $nn = $node;
+
+	# Text like "chapter", "appendix", "section", etc in the index
+	# makes it unnecessarily wide
+	$nn =~ s/^.*\s+//g;	# Remove all but the actual index information
+
+	push @a, "n ," if $sep;
+	push @a, "sp", "x $xn", "n $nn", "xe$xn";
+	$sep = 1;
     }
     print "<li class=\"index\">\n";
     $line = '';


More information about the Nasm-commits mailing list