diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2017-04-14 10:27:13 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2017-04-14 10:27:13 -0700 |
commit | 48e2009f6286130bf5b08b63170492fe0ab1957a (patch) | |
tree | ffbcfd6d2b29cf3fb33122e8eb864f470d9afc23 | |
parent | 704c2c6b70189c633146a3eda3184de07d2fea68 (diff) | |
download | nasm-48e2009f6286130bf5b08b63170492fe0ab1957a.tar.gz |
doc: in the HTML navbar, be explicit about the target
Show thinks like "Chapter 2" and "Chapter 4" instead of "Previous
Chapter"/"Next Chapter".
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r-- | doc/rdsrc.pl | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/doc/rdsrc.pl b/doc/rdsrc.pl index 719e9b2d..c79ac2e2 100644 --- a/doc/rdsrc.pl +++ b/doc/rdsrc.pl @@ -795,7 +795,8 @@ sub write_html { print "writing chapter files..."; open TEXT, '>', File::Spec->devnull(); select TEXT; - $html_lastf = ''; + undef $html_nav_last; + undef $html_nav_next; $in_list = 0; $in_bquo = 0; @@ -818,9 +819,9 @@ sub write_html { $title = "Chapter $1: "; $xref = $2; print "</body>\n</html>\n"; select STDOUT; close TEXT; - $html_lastf = $html_fnames{$chapternode}; + $html_nav_last = $chapternode; $chapternode = $nodexrefs{$xref}; - $html_nextf = $html_fnames{$tstruct_mnext{$chapternode}}; + $html_nav_next = $tstruct_mnext{$chapternode}; open(TEXT, '>', File::Spec->catfile($out_path, $html_fnames{$chapternode})); select TEXT; &html_preamble(1); @@ -836,9 +837,9 @@ sub write_html { $title = "Appendix $1: "; $xref = $2; print "</body>\n</html>\n"; select STDOUT; close TEXT; - $html_lastf = $html_fnames{$chapternode}; + $html_nav_last = $chapternode; $chapternode = $nodexrefs{$xref}; - $html_nextf = $html_fnames{$tstruct_mnext{$chapternode}}; + $html_nav_next = $tstruct_mnext{$chapternode}; open(TEXT, '>', File::Spec->catfile($out_path, $html_fnames{$chapternode})); select TEXT; &html_preamble(1); @@ -956,8 +957,14 @@ sub html_preamble { sub html_jumppoints { print "<ul class=\"navbar\">\n"; - print "<li class=\"first\"><a class=\"prev\" href=\"$html_lastf\">Previous Chapter</a></li>\n" if $html_lastf; - print "<li><a class=\"next\" href=\"$html_nextf\">Next Chapter</a></li>\n" if $html_nextf; + if (defined($html_nav_last)) { + my $lastf = $html_fnames{$html_nav_last}; + print "<li class=\"first\"><a class=\"prev\" href=\"$lastf\">$html_nav_last</a></li>\n"; + } + if (defined($html_nav_next)) { + my $nextf = $html_fnames{$html_nav_next}; + print "<li><a class=\"next\" href=\"$nextf\">$html_nav_next</a></li>\n"; + } print "<li><a class=\"toc\" href=\"nasmdoc0.html\">Contents</a></li>\n"; print "<li class=\"last\"><a class=\"index\" href=\"nasmdoci.html\">Index</a></li>\n"; print "</ul>\n"; |