X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Documentation%2Flilypond-texi2html.init;h=9635e3a41b9f206d7756ea9dd51669c43f42b586;hb=662f7fa0284ab9fae27942934c41354d64a5958e;hp=bb914dbc1d49b6947254aff928bbfa18e0ff860c;hpb=b9ebbcefd5122fefc2de7b15a52c58459e4fd784;p=lilypond.git diff --git a/Documentation/lilypond-texi2html.init b/Documentation/lilypond-texi2html.init index bb914dbc1d..9635e3a41b 100644 --- a/Documentation/lilypond-texi2html.init +++ b/Documentation/lilypond-texi2html.init @@ -879,8 +879,14 @@ sub lilypond_element_target_name($$$) } # TODO: Once texi2html correctly prints out the target and not the id for # the sections, change this back to ($id, $target) + # I don't understand this comment, so I'm reluctant to delete it -gp $target = lc($target); - return ($target, $target); + if ($target eq lc($id)) { + $id = ""; + } else { + $id = substr($id, 0, - 2); # remove the "-1" + } + return ($id, $target); } @@ -976,8 +982,6 @@ sub lilypond_unknown($$$$$) } - - my %translated_books = (); # Construct a href to an external source of information. # node is the node with texinfo @-commands @@ -1023,13 +1027,32 @@ sub lilypond_external_href($$$) } if (defined $file) { - return &$default_external_href($node, $node_id, $node_hxmlt_id, lc($file)); + $href = &$default_external_href($node, $node_id, $node_hxmlt_id, lc($file)); + remove_unneeded_anchor($href); + return $href; } else { - return &$default_external_href($node, $node_id, $node_hxmlt_id); + $href = &$default_external_href($node, $node_id, $node_hxmlt_id); + remove_unneeded_anchor($href); + return $href; } } - +sub remove_unneeded_anchor($) +{ + my $ref = shift; + my @hrefsplit = split("/", $href); + for ($i = 0; $i < @hrefsplit; $i++) { + $item = @hrefsplit[$i]; + if ($item =~ /#/) { + @splitted = split("#", $item); + if (@splitted[0] == @splitted[1]) { + @hrefsplit[$i] = @splitted[0] + } + } + } + $href = join("/", @hrefsplit); + return $href +} @@ -1225,9 +1248,8 @@ sub lilypond_print_toc_div ($$) } else { $lang = ""; } - my $reldir = ""; - $reldir = "../" if ($Texi2HTML::Config::SPLIT eq 'section'); - my $uplink = $reldir."web/manuals.${lang}html"; + my $reldir = $ENV{DEPTH}; + my $uplink = $reldir."/Documentation/web/manuals.${lang}html"; if (not $web_manual) { print $fh "