Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bf8ec3e

Browse files
committed
- add link relationships to some of the links in the navigation panels
- implement custom_REL_hook() so LaTeX2HTML uses currently recommended link types; those work fine with tools like the Mozilla Site Navigation Bar
1 parent 5466296 commit bf8ec3e

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

Doc/perl/l2hinit.perl

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,16 @@ sub custom_driver_hook {
9999

100100
$CUSTOM_BUTTONS = '';
101101

102-
sub make_nav_sectref($$) {
103-
my($label, $title) = @_;
102+
sub make_nav_sectref($$$) {
103+
my($label, $linktype, $title) = @_;
104104
if ($title) {
105105
if ($title =~ /\<[aA] /) {
106-
$title =~ s/\<[aA] /<a class="sectref" /;
106+
$title =~ s/\<[aA] /<a class="sectref" rel="$linktype" /;
107107
}
108108
else {
109109
$title = "<span class=\"sectref\">$title</span>";
110110
}
111-
return "<b class=\"navlabel\">$label:</b> $title\n";
111+
return "<b class=\"navlabel\">$label:</b>\n$title\n";
112112
}
113113
return '';
114114
}
@@ -175,9 +175,9 @@ ()
175175
. "\n<td>$INDEX</td>"
176176
. "\n</tr></table>\n"
177177
# textual navigation
178-
. make_nav_sectref("Previous", $PREVIOUS_TITLE)
179-
. make_nav_sectref("Up", $UP_TITLE)
180-
. make_nav_sectref("Next", $NEXT_TITLE)
178+
. make_nav_sectref("Previous", "prev", $PREVIOUS_TITLE)
179+
. make_nav_sectref("Up", "parent", $UP_TITLE)
180+
. make_nav_sectref("Next", "next", $NEXT_TITLE)
181181
);
182182
# remove these; they are unnecessary and cause errors from validation
183183
$s =~ s/ NAME="tex2html\d+"\n */ /g;
@@ -581,6 +581,15 @@ sub set_depth_levels {
581581
%declarations);
582582

583583

584+
# This is used to map the link rel attributes LaTeX2HTML uses to those
585+
# currently recommended by the W3C.
586+
sub custom_REL_hook {
587+
my($rel,$junk) = @_;
588+
return 'parent' if $rel eq 'up';
589+
return 'prev' if $rel eq 'previous';
590+
return $rel;
591+
}
592+
584593
# This is added to get rid of the long comment that follows the
585594
# doctype declaration; MSIE5 on NT4 SP4 barfs on it and drops the
586595
# content of the page.

0 commit comments

Comments
 (0)