aboutsummaryrefslogtreecommitdiffstats
path: root/doc/genps.pl
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2002-05-15 21:13:59 +0000
committerH. Peter Anvin <hpa@zytor.com>2002-05-15 21:13:59 +0000
commitcae60c43448f099abf08863aa20e3a38f25a0bed (patch)
treece37a6e6037bb880154f8b7e88e1fb1d4e45582c /doc/genps.pl
parent13a9b0351e1dcb44d02f355d9bf96c28a55bbf56 (diff)
downloadnasm-daily-cae60c43448f099abf08863aa20e3a38f25a0bed.tar.gz
nasm-daily-cae60c43448f099abf08863aa20e3a38f25a0bed.tar.xz
nasm-daily-cae60c43448f099abf08863aa20e3a38f25a0bed.zip
Strip the anchor tags from the table of contents
Diffstat (limited to 'doc/genps.pl')
-rwxr-xr-xdoc/genps.pl20
1 files changed, 18 insertions, 2 deletions
diff --git a/doc/genps.pl b/doc/genps.pl
index a741be93..14db4d7f 100755
--- a/doc/genps.pl
+++ b/doc/genps.pl
@@ -509,6 +509,22 @@ sub ps_dup_para(@) {
}
#
+# This generates a duplicate of a paragraph, stripping anchor
+# tags (-4 and -5)
+#
+sub ps_dup_para_noanchor(@) {
+ my(@i) = @_;
+ my(@o) = ();
+ my($c);
+
+ foreach $c ( @i ) {
+ my @cc = @{$c};
+ push(@o, [@cc]) unless ( $cc[0] == -4 || $cc[0] == -5 );
+ }
+ return @o;
+}
+
+#
# Scan for header paragraphs and fix up their contents;
# also generate table of contents and PDF bookmarks.
#
@@ -535,7 +551,7 @@ for ( $i = 0 ; $i < $npara ; $i++ ) {
push(@bookmarks, $book);
$bookref{$secn} = $book;
- push(@tocparas, [ps_dup_para(@{$paras[$i]})]);
+ push(@tocparas, [ps_dup_para_noanchor(@{$paras[$i]})]);
push(@tocptypes, 'toc0'.' :'.$sech.':'.$chap.' '.$secn.':');
unshift(@{$paras[$i]},
@@ -555,7 +571,7 @@ for ( $i = 0 ; $i < $npara ; $i++ ) {
$bookref{$secn} = $book;
$bookref{$pref}->[1]--; # Adjust count for parent node
- push(@tocparas, [ps_dup_para(@{$paras[$i]})]);
+ push(@tocparas, [ps_dup_para_noanchor(@{$paras[$i]})]);
push(@tocptypes,
(($ptype eq 'subh') ? 'toc2':'toc1').' :'.$sech.':'.$secn);