my $docnr = 0;
my $page_toc_depth = 2;
my @default_toc = [];
+my @section_to_filename;
use Data::Dumper;
$Data::Dumper::Maxdepth = 2;
} else {
# derive the name of the anchor (i.e. the part after # in the links!),
# don't use texi2html's SECx.x default!
- my $anchor = main::remove_texi($$element{texi});
+ my $sec_name = main::remove_texi($$element{texi});
+ my $anchor = $sec_name;
if ($$element{translationof}) {
$anchor = main::remove_texi($$element{translationof});
}
$docnr += 1;
$$element{doc_nr} = $docnr;
$lastfilename = $filename;
+ push (@section_to_filename, [$sec_name, $filename, $anchor]);
return $filename;
} else {
$$element{doc_nr} = $docnr;
+ push (@section_to_filename, [$sec_name, $lastfilename, $anchor]);
return $lastfilename;
}
}
return;
}
+sub lilypond_finish_out()
+{
+ my $map_filename = "$Texi2HTML::THISDOC{'destination_directory'}$Texi2HTML::THISDOC{'file_base_name'}_xref.map";
+ if (open(XREFFILE, ">$map_filename")) {
+ foreach (@section_to_filename) {
+ my ($sec, $file, $anchor) = @$_;
+ print XREFFILE "$sec\t$file\t$anchor\n";
+ }
+ close XREFFILE;
+ } else {
+ print "Can't open $map_filename for writing: $! The map of X-refs will not be written out\n";
+ }
+}
+
# The default formatting of external refs returns e.g.
$Texi2HTML::Config::external_ref = \&lilypond_external_ref;
$Texi2HTML::Config::toc_body = \&lilypond_toc_body;
$Texi2HTML::Config::css_lines = \&lilypond_css_lines;
+$Texi2HTML::Config::finish_out = \&lilypond_finish_out;
# For split pages, use index(.lang).html as start page!