3 ### texi2html customization script for Lilypond
4 ### Author: Reinhold Kainhofer <reinhold@kainhofer.com>, 2008.
5 ### Some code parts copied from texi2html and adapted.
9 ### Features implemented here:
10 ### -) For split manuals, the main page is index.html.
11 ### -) All @unnumbered* sections are placed into the same file
12 ### (implemented by split_at_numbered_sections)
13 ### -) Use our custom CSS file, with IE-specific fixes in another CSS file,
14 ### impelmented by lilypond_css_lines
15 ### -) TOC (folded, with the current page highlighted) in an iframe is added
16 ### to every page; implemented by:
17 ### lilypond_print_element_header -- building of the TOC
18 ### lilypond_toc_body -- generation of customized TOC output
19 ### lilypond_print_page_head -- start <div id="main">
20 ### print_lilypond_page_foot -- closing id=main, output of footer & TOC
21 ### -) External refs are formatted only as "Text of the node" (not as >>see
22 ### "NODE" section "SECTION" in "BOOK"<< like with default texi2html). Also,
23 ### the leading "(book-name)" is removed.
24 ### Implemented by overriding lilypond_external_ref
25 ### -) Navigation bars on top/bottom of the page and between sections are not
26 ### left-aligned, but use a combination of left/center/right aligned table
27 ### cells; For this, I heavily extend the texi2html code to allow for
28 ### differently aligned cells and for multi-line tables);
29 ### Implemented in lilypond_print_navigation
30 ### -) Different formatting than the default: example uses the same formatting
32 ### -) Allow translated section titles: All section titles can be translated,
33 ### the original (English) title is associated with @translationof. This is
34 ### needed, because the file name / anchor is generated from the original
35 ### English title, since otherwise language-autoselection would break with
37 ### Since it is then no longer possible to obtain the file name from the
38 ### section title, I keep a sectionname<=>filename/anchor around. This way,
39 ### xrefs from other manuals can simply load that map and retrieve the
40 ### correct file name for the link. Implemented in:
41 ### lilypond_unknown (handling of @translationof, in case
42 ### extract_texi_filenames.py messes up...)
43 ### split_at_numbered_sections (correct file name: use the map)
44 ### lilypond_init_map (read in the externally created map from disk)
45 ### lilypond_external_href (load the map for xrefs, use the correct
49 ### Useful helper functions:
50 ### -) texinfo_file_name($node_name): returns a texinfo-compatible file name
51 ### for the given string $node_name (whitespace trimmed/replaced by -,
52 ### non-standard chars replaced by _xxxx (ascii char code) and forced to
53 ### start with a letter by prepending t_g if necessary)
56 package Texi2HTML::Config;
62 #############################################################################
63 ### SETTINGS FOR TEXI2HTML
64 #############################################################################
66 @Texi2HTML::Config::CSS_REFS = ("lilypond.css");
67 $Texi2HTML::Config::USE_ACCESSKEY = 1;
68 $Texi2HTML::Config::USE_LINKS = 1;
69 $Texi2HTML::Config::USE_REL_REV = 1;
70 $Texi2HTML::Config::element_file_name = \&split_at_numbered_sections;
71 $Texi2HTML::Config::print_element_header = \&lilypond_print_element_header;
72 $Texi2HTML::Config::print_page_foot = \&print_lilypond_page_foot;
73 $Texi2HTML::Config::print_navigation = \&lilypond_print_navigation;
74 $Texi2HTML::Config::external_ref = \&lilypond_external_ref;
75 $Texi2HTML::Config::external_href = \&lilypond_external_href;
76 $Texi2HTML::Config::toc_body = \&lilypond_toc_body;
77 $Texi2HTML::Config::css_lines = \&lilypond_css_lines;
78 $Texi2HTML::Config::unknown = \&lilypond_unknown;
79 $Texi2HTML::Config::print_page_head = \&lilypond_print_page_head;
81 # Examples should be formatted similar to quotes:
82 $Texi2HTML::Config::complex_format_map->{'example'} = {
83 'begin' => q{"<blockquote><pre class=\"example\">"},
84 'end' => q{"</pre></blockquote>\n"},
88 my @section_to_filename;
93 #############################################################################
95 #############################################################################
98 $Data::Dumper::Maxdepth = 2;
100 sub print_element_info($)
103 print "~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
104 print "Element: $element\n";
105 print Dumper($element);
112 #############################################################################
114 #############################################################################
116 # Convert a given node name to its proper file name (normalization as explained
117 # in the texinfo manual:
118 # http://www.gnu.org/software/texinfo/manual/texinfo/html_node/HTML-Xref-Node-Name-Expansion.html
119 sub texinfo_file_name($)
123 # File name normalization by texinfo:
124 # 1/2: letters and numbers are left unchanged
125 # 3/4: multiple, leading and trailing whitespace is removed
126 $text = main::normalise_space($text);
127 # 5/6: all remaining spaces are converted to '-', all other 7- or 8-bit
128 # chars are replaced by _xxxx (xxxx=ascii character code)
129 while ($text ne '') {
130 if ($text =~ s/^([A-Za-z0-9]+)//o) { # number or letter stay unchanged
132 } elsif ($text =~ s/^ //o) { # space -> '-'
134 } elsif ($text =~ s/^(.)//o) { # Otherwise use _xxxx (ascii char code)
136 if ( $ccode <= 0xFFFF ) {
137 $result .= sprintf("_%04x", $ccode);
139 $result .= sprintf("__%06x", $ccode);
143 # 7: if name does not begin with a letter, prepend 't_g' (so it starts with a letter)
144 if ($result !~ /^[a-zA-Z]/) {
145 $result = 't_g' . $result;
152 # Load a file containing a nodename<=>filename map (tab-sepatared, i.e.
153 # NODENAME\tFILENAME\tANCHOR
154 # Returns a ref to a hash "Node title" => ["FilenameWithoutExt", "Anchor"]
155 sub load_map_file ($)
160 if (open(XREFFILE, $mapfile)) {
162 while ( $line = <XREFFILE> ) {
163 # parse the tab-separated entries and insert them into the map:
165 my @entries = split(/\t/, $line);
166 if (scalar (@entries) == 3) {
167 $node_map->{$entries[0]} = [$entries[1], $entries[2]];
169 print STDERR "Invalid entry in the node file $mapfile: $line\n";
174 print STDERR "WARNING: Unable to load the map file $mapfile\n";
180 # Split the given path into dir and basename (with .texi removed). Used mainly
181 # to get the path/basename of the original texi input file
182 sub split_texi_filename ($)
185 my $docu_dir, $docu_name;
186 if ($docu =~ /(.*\/)/) {
187 chop($docu_dir = $1);
189 $docu_name =~ s/.*\///;
194 $docu_name =~ s/\.te?x(i|info)?$//;
195 return ($docu_dir, $docu_name);
202 #############################################################################
204 #############################################################################
206 # Include our standard CSS file, not hard-coded CSS code directly in the HTML!
207 # For IE, conditionally include the lilypond-ie-fixes.css style sheet
208 sub lilypond_css_lines ($$)
210 my $import_lines = shift;
211 my $rule_lines = shift;
212 return if (defined($CSS_LINES));
213 if (@$rule_lines or @$import_lines)
215 $CSS_LINES = "<style type=\"text/css\">\n<!--\n";
216 $CSS_LINES .= join('',@$import_lines) . "\n" if (@$import_lines);
217 $CSS_LINES .= join('',@$rule_lines) . "\n" if (@$rule_lines);
218 $CSS_LINES .= "-->\n</style>\n";
220 foreach my $ref (@CSS_REFS)
222 $CSS_LINES .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"$ref\">\n";
224 $CSS_LINES .= "<!--[if lte IE 7]>\n<link href=\"lilypond-ie-fixes.css\" rel=\"stylesheet\" type=\"text/css\">\n<![endif]-->\n";
231 #############################################################################
232 ### SPLITTING BASED ON NUMBERED SECTIONS
233 #############################################################################
237 my $node_to_filename_map = ();
239 # This function makes sure that files are only generated for numbered sections,
240 # but not for unnumbered ones. It is called after texi2html has done its own
241 # splitting and simply returns the filename for the node given as first argument
242 # Nodes with the same filename will be printed out to the same filename, so
243 # this really all we need. Also, make sure that the file names for sections
244 # are derived from the section title. We also might want to name the anchors
245 # according to node titles, which works by simply overriding the id element of
247 # If an external nodename<=>filename/anchor map file is found (loaded in
248 # lilypond_init_out, use the externally created values, otherwise use the
250 sub split_at_numbered_sections($$$)
254 my $docu_name = shift;
255 my $docu_ext = $Texi2HTML::Config::EXTENSION;
257 my $node_name = main::remove_texi($element->{'node_ref'}->{'texi'});
258 # the snippets page does not use nodes for the snippets, so in this case
259 # we'll have to use the section name!
260 if ($node_name eq '') {
261 $node_name = main::remove_texi($element->{'texi'});
264 # If we have an entry in the section<=>filename map, use that one, otherwise
265 # generate the filename/anchor here. In the latter case, external manuals
266 # will not be able to retrieve the file name for xrefs!!! Still, I already
267 # had that code, so I'll leave it in in case something goes wrong with the
268 # extract_texi_filenames.py script in the lilypond build process!
269 if (exists ($node_to_filename_map->{$node_name})) {
270 (my $filename, my $anchor) = @{$node_to_filename_map->{$node_name}};
271 $filename .= ".$docu_ext" if (defined($docu_ext));
273 $element->{id} = $anchor;
274 if ($filename eq $lastfilename) {
275 $$element{doc_nr} = $docnr;
278 $$element{doc_nr} = $docnr;
279 $lastfilename = $filename;
283 } elsif ($type eq "top" or $type eq "toc" or $type eq "doc" or $type eq "stoc" or $type eq "foot" or $type eq "about") {
284 # TOC, footer, about etc. are called with undefined $element and $type == "toc"|"stoc"|"foot"|"about"
287 print STDERR "WARNING: Node '$node_name' was NOT found in the map\n"
288 unless ($node_name eq '') or ($element->{'tag'} eq 'unnumberedsec')
289 or ($node_name =~ /NOT REALLY USED/);
291 # derive the name of the anchor (i.e. the part after # in the links!),
292 # don't use texi2html's SECx.x default!
293 my $sec_name = main::remove_texi($element->{'texi'});
294 # if we have a node, use its name:
295 if ($element->{'node_ref'}->{'texi'} ne '') {
296 $sec_name = main::remove_texi($element->{'node_ref'}->{'texi'});
298 my $anchor = $sec_name;
299 if ($element->{translationof}) {
300 $anchor = main::remove_texi($$element{translationof});
302 # normalize to the same file name as texinfo
303 $anchor = texinfo_file_name($anchor);
304 $$element{id} = $anchor;
305 # Numbered sections will get a filename Node_title, unnumbered sections will use
306 # the file name of the previous numbered section:
307 if (($element->{number}) or ($lastfilename eq '') or ($element->{level} == 1)) {
308 my $filename = $anchor;
309 $filename .= ".$docu_ext" if (defined($docu_ext));
311 $$element{doc_nr} = $docnr;
312 $lastfilename = $filename;
315 $$element{doc_nr} = $docnr;
316 return $lastfilename;
324 ## Load the map file for the corrently processed texi file. We do this
325 # (mis-)using a command init handler, since texi2html does not have any
326 # other hooks that are called after THISDOC is filled but before phase 2
327 # of the texi2html conversion.
328 sub lilypond_init_map ()
330 my ($docu_dir, $docu_name) = split_texi_filename ($Texi2HTML::THISDOC{'input_file_name'});
331 my $map_filename = main::locate_include_file ("${docu_name}.$Texi2HTML::THISDOC{current_lang}.xref-map")
332 || main::locate_include_file ("${docu_name}.xref-map");
333 $node_to_filename_map = load_map_file ($map_filename);
335 push @Texi2HTML::Config::command_handler_init, \&lilypond_init_map;
339 #############################################################################
340 ### CLEANER LINK TITLE FOR EXTERNAL REFS
341 #############################################################################
343 # The default formatting of external refs returns e.g.
344 # "(lilypond-internals)Timing_translator", so we remove all (...) from the
345 # file_and_node argument. Also, we want only a very simple format, so we don't
346 # even call the default handler!
347 sub lilypond_external_ref($$$$$$)
352 my $file_node = shift;
354 my $cross_ref = shift;
356 my $displaytext = '';
358 # 1) if we have a cross ref name, that's the text to be displayed:
359 # 2) For the top node, use the (printable) name of the manual, unless we
360 # have an explicit cross ref name
361 # 3) In all other cases use the section name
362 if ($cross_ref ne '') {
363 $displaytext = $cross_ref;
364 } elsif (($section eq '') or ($section eq 'Top')) {
365 $displaytext = $book;
367 $displaytext = $section;
370 $displaytext = &$anchor('', $href, $displaytext) if ($displaytext ne '');
371 return &$I('%{node_file_href}', { 'node_file_href' => $displaytext });
373 # Default: format as "see <a ..>NODE</a> section 'SECTION' in BOOK". We don't want this!
374 # return t2h_default_external_ref($type, $section, $book, $file_node, $href, $cross_ref);
381 #############################################################################
382 ### HANDLING TRANSLATED SECTIONS: handle @translationof, secname<->filename
383 ### map stored on disk, xrefs in other manuals load that map
384 #############################################################################
387 # Try to make use of @translationof to generate files according to the original
388 # English section title...
389 sub lilypond_unknown($$$$$)
397 # the @translationof macro provides the original English section title,
398 # which should be used for file/anchor naming, while the title will be
399 # translated to each language
400 # It is already used by extract_texi_filenames.py, so this should not be
401 # necessary here at all. Still, I'll leave the code in just in case the
402 # python script messed up ;-)
403 if ($pass == 1 and $macro eq "translationof") {
404 if (ref($state->{'element'}) eq 'HASH') {
405 $state->{'element'}->{'translationof'} = main::normalise_space($line);
407 return ('', true, undef, undef);
409 return t2h_default_unknown($macro, $line, $pass, $stack, $state);
416 my %translated_books = ();
417 # Construct a href to an external source of information.
418 # node is the node with texinfo @-commands
419 # node_id is the node transliterated and transformed as explained in the
421 # node_xhtml_id is the node transformed such that it is unique and can
422 # be used to make an html cross ref as explained in the texinfo manual
423 # file is the file in '(file)node'
424 sub lilypond_external_href($$$)
428 my $node_hxmlt_id = shift;
430 my $original_func = \&t2h_default_external_href;
432 # 1) Keep a hash of book->section_map
433 # 2) if not file in keys hash => try to load the map (assign empty map if
434 # non-existent => will load only once!)
435 # 3) if node in the section=>(file, anchor) map, replace node_id and
436 # node_xhtml_id by the map's values
437 # 4) call the t2h_default_external_href with these values (or the old ones if not found)
439 if (($node_id ne '') and defined($file) and ($node_id ne 'Top')) {
440 my $map_name = $file;
441 $map_name =~ s/-big-page//;
443 # Load the map if we haven't done so already
444 if (!exists($translated_books{$map_name})) {
445 my ($docu_dir, $docu_name) = split_texi_filename ($Texi2HTML::THISDOC{'input_file_name'});
446 my $map_filename = main::locate_include_file ("${map_name}.$Texi2HTML::THISDOC{current_lang}.xref-map")
447 || main::locate_include_file ("${map_name}.xref-map");
448 $translated_books{$map_name} = load_map_file ($map_filename);
451 # look up translation. use these values instead of the old filename/anchor
452 my $section_name_map = $translated_books{$map_name};
453 my $node_text = main::remove_texi($node);
454 if (defined($section_name_map->{$node_text})) {
455 ($node_id, $node_hxmlt_id) = @{$section_name_map->{$node_text}};
457 print STDERR "WARNING: Unable to find node '$node_text' in book $map_name.\n";
462 return &$original_func($node, $node_id, $node_hxmlt_id, $file);
464 return &$original_func($node, $node_id, $node_hxmlt_id);
472 #############################################################################
473 ### CUSTOM TOC FOR EACH PAGE (in a frame on the left)
474 #############################################################################
476 my $page_toc_depth = 2;
477 my @default_toc = [];
479 # recursively generate the TOC entries for the element and its children (which
480 # are only shown up to maxlevel. All ancestors of the current element are also
481 # shown with their immediate children, irrespective of their level.
482 # Unnumbered entries are only printed out if they are at top-level or their
483 # parent element is an ancestor of the currently viewed node.
484 sub generate_ly_toc_entries($$$$)
487 my $element_path = shift;
488 my $maxlevel = shift;
489 my $always_show_unnumbered_children = shift;
490 # Skip undefined sections, plus all sections generated by index splitting
491 return() if (not defined($element) or exists($element->{'index_page'}));
493 my $level = $element->{'toc_level'};
494 my $is_parent_of_current = $element->{'id'} && $element_path->{$element->{'id'}};
495 my $print_children = ( ($level < $maxlevel) or $is_parent_of_current );
496 my $ind = ' ' x $level;
497 my $this_css_class = $is_parent_of_current ? " class=\"toc_current\"" : "";
499 my $entry = "$ind<li$this_css_class>" . &$anchor ($element->{'tocid'}, "$element->{'file'}#$element->{'id'}",$element->{'text'});
501 my $children = $element->{'section_childs'};
502 # Don't add unnumbered entries, unless they are at top-level or a parent of the current!
503 if (not ($element->{'number'} or $always_show_unnumbered_children)) {
506 if ( $print_children and defined($children) and (ref($children) eq "ARRAY") ) {
507 push (@result, $entry);
508 my @child_result = ();
509 foreach (@$children) {
510 push (@child_result, generate_ly_toc_entries($_, $element_path, $maxlevel, $is_parent_of_current));
512 # if no child nodes were generated, e.g. for the index, where expanded pages
513 # are ignored, don't generate a list at all...
515 push (@result, "\n$ind<ul$NO_BULLET_LIST_ATTRIBUTE>\n");
516 push (@result, @child_result);
517 push (@result, "$ind</ul></li>\n");
520 push (@result, $entry . "</li>\n");
526 # Print a customized TOC, containing only the first two levels plus the whole
527 # path to the current page
528 sub lilypond_generate_page_toc_body($)
531 my $current_element = $element;
533 $parentelements{$element->{'id'}} = 1;
534 # Find the path to the current element
535 while ( defined($current_element->{'sectionup'}) and
536 ($current_element->{'sectionup'} ne $current_element) )
538 $parentelements{$current_element->{'sectionup'}->{'id'}} = 1
539 if ($current_element->{'sectionup'}->{'id'} ne '');
540 $current_element = $current_element->{'sectionup'};
542 return () if not defined($current_element);
543 # Create the toc entries recursively
544 my @toc_entries = ("<div class=\"contents\">\n", "<ul$NO_BULLET_LIST_ATTRIBUTE>\n");
545 my $children = $current_element->{'section_childs'};
546 foreach ( @$children ) {
547 push (@toc_entries, generate_ly_toc_entries($_, \%parentelements, $page_toc_depth, False));
549 push (@toc_entries, "</ul>\n");
550 push (@toc_entries, "</div>\n");
554 sub lilypond_print_toc_div ($$)
558 my @lines = @$tocref;
559 # use default TOC if no custom lines have been generated
560 @lines = @default_toc if (not @lines);
562 print $fh "\n\n<div id=\"tocframe\">\n";
563 print $fh '<h4> ' . $Texi2HTML::NAME{'Contents'} . "</h4>\n";
564 foreach my $line (@lines) {
567 print $fh "</div>\n\n";
571 # Create the custom TOC for this page (partially folded, current page is
572 # highlighted) and store it in a global variable. The TOC is written out after
573 # the html contents (but positioned correctly using CSS), so that browsers with
574 # css turned off still show the contents first.
575 our @this_page_toc = ();
576 sub lilypond_print_element_header
579 my $first_in_page = shift;
580 my $previous_is_top = shift;
581 if ($first_in_page and not @this_page_toc) {
582 if (defined($Texi2HTML::THIS_ELEMENT)) {
583 # Create the TOC for this page
584 @this_page_toc = lilypond_generate_page_toc_body($Texi2HTML::THIS_ELEMENT);
587 return T2H_DEFAULT_print_element_header( $fh, $first_in_page, $previous_is_top);
590 # Generate the HTML output for the TOC
591 sub lilypond_toc_body($)
593 my $elements_list = shift;
594 # Generate a default TOC for pages without THIS_ELEMENT
595 @default_toc = lilypond_generate_page_toc_body(@$elements_list[0]);
596 return T2H_GPL_toc_body($elements_list);
599 # Print out the TOC in a <div> at the beginning of the page
600 sub lilypond_print_page_head($)
603 T2H_DEFAULT_print_page_head($fh);
604 print $fh "<div id=\"main\">\n";
607 # Print out the TOC in a <div> at the end of th page, which will be formatted as a
608 # sidebar mimicking a TOC frame
609 sub print_lilypond_page_foot($)
612 my $program_string = &$program_string();
613 print $fh "<p><font size='-1'>$program_string</font><br>$PRE_BODY_CLOSE</p>\n";
614 print $fh "<!-- FOOTER -->\n\n";
615 print $fh "<!-- end div#main here -->\n</div>\n\n";
617 # Print the TOC frame and reset the TOC:
618 lilypond_print_toc_div ($fh, \@this_page_toc);
622 print $fh "</body>\n</html>\n";
629 #############################################################################
630 ### NICER / MORE FLEXIBLE NAVIGATION PANELS
631 #############################################################################
633 sub get_navigation_text
636 my $text = $NAVIGATION_TEXT{$button};
637 if ( ($button eq 'Back') or ($button eq 'FastBack') ) {
638 $text = $text . $Texi2HTML::NODE{$button} . " ";
639 } elsif ( ($button eq 'Forward') or ($button eq 'FastForward') ) {
640 $text = " " . $Texi2HTML::NODE{$button} . $text;
641 } elsif ( $button eq 'Up' ) {
642 $text = " ".$text.": " . $Texi2HTML::NODE{$button} . " ";
648 # Don't automatically create left-aligned table cells for every link, but
649 # instead create a <td> only on an appropriate '(left|right|center)-aligned-cell-n'
650 # button text. It's alignment as well as the colspan will be taken from the
651 # name of the button. Also, add 'newline' button text to create a new table
652 # row. The texts of the buttons are generated by get_navigation_text and
653 # will contain the name of the next/previous section/chapter.
654 sub lilypond_print_navigation
658 my $vertical = shift;
660 # print $fh '<table cellpadding="', $spacing, '" cellspacing="', $spacing,
661 # "\" border=\"0\" class=\"nav_table\">\n";
662 print $fh "<table class=\"nav_table\">\n";
664 print $fh "<tr>" unless $vertical;
666 foreach my $button (@$buttons)
668 print $fh qq{<tr valign="top" align="left">\n} if $vertical;
669 # Allow (left|right|center)-aligned-cell and newline as buttons!
670 if ( $button =~ /^(.*)-aligned-cell-(.*)$/ )
672 print $fh qq{</td>} unless $beginofline;
673 print $fh qq{<td valign="middle" align="$1" colspan="$2">};
676 elsif ( $button eq 'newline' )
678 print $fh qq{</td>} unless $beginofline;
684 elsif (ref($button) eq 'CODE')
686 &$button($fh, $vertical);
688 elsif (ref($button) eq 'SCALAR')
690 print $fh "$$button" if defined($$button);
692 elsif (ref($button) eq 'ARRAY')
694 my $text = $button->[1];
695 my $button_href = $button->[0];
696 # verify that $button_href is simple text and text is a reference
697 if (defined($button_href) and !ref($button_href)
698 and defined($text) and (ref($text) eq 'SCALAR') and defined($$text))
700 if ($Texi2HTML::HREF{$button_href})
702 my $anchor_attributes = '';
703 if ($USE_ACCESSKEY and (defined($BUTTONS_ACCESSKEY{$button_href})) and ($BUTTONS_ACCESSKEY{$button_href} ne ''))
705 $anchor_attributes = "accesskey=\"$BUTTONS_ACCESSKEY{$button_href}\"";
707 if ($USE_REL_REV and (defined($BUTTONS_REL{$button_href})) and ($BUTTONS_REL{$button_href} ne ''))
709 $anchor_attributes .= " rel=\"$BUTTONS_REL{$button_href}\"";
713 $Texi2HTML::HREF{$button_href},
714 get_navigation_text($$text),
720 print $fh get_navigation_text($$text);
724 elsif ($button eq ' ')
725 { # handle space button
727 ($ICONS && $ACTIVE_ICONS{' '}) ?
728 &$button_icon_img($BUTTONS_NAME{$button}, $ACTIVE_ICONS{' '}) :
729 $NAVIGATION_TEXT{' '};
732 elsif ($Texi2HTML::HREF{$button})
734 my $btitle = $BUTTONS_GOTO{$button} ?
735 'title="' . $BUTTONS_GOTO{$button} . '"' : '';
736 if ($USE_ACCESSKEY and (defined($BUTTONS_ACCESSKEY{$button})) and ($BUTTONS_ACCESSKEY{$button} ne ''))
738 $btitle .= " accesskey=\"$BUTTONS_ACCESSKEY{$button}\"";
740 if ($USE_REL_REV and (defined($BUTTONS_REL{$button})) and ($BUTTONS_REL{$button} ne ''))
742 $btitle .= " rel=\"$BUTTONS_REL{$button}\"";
744 if ($ICONS && $ACTIVE_ICONS{$button})
748 $Texi2HTML::HREF{$button},
749 &$button_icon_img($BUTTONS_NAME{$button},
750 $ACTIVE_ICONS{$button},
751 $Texi2HTML::SIMPLE_TEXT{$button}),
760 $Texi2HTML::HREF{$button},
761 get_navigation_text ($button),
768 { # button is passive
770 $ICONS && $PASSIVE_ICONS{$button} ?
771 &$button_icon_img($BUTTONS_NAME{$button},
772 $PASSIVE_ICONS{$button},
773 $Texi2HTML::SIMPLE_TEXT{$button}) :
775 "[" . get_navigation_text($button) . "]";
777 print $fh "</td>\n" if $vertical;
778 print $fh "</tr>\n" if $vertical;
780 print $fh "</td>" unless $beginofline;
781 print $fh "</tr>" unless $vertical;
782 print $fh "</table>\n";
786 @Texi2HTML::Config::SECTION_BUTTONS =
787 ('left-aligned-cell-1', 'FastBack',
788 'center-aligned-cell-3', 'Top', 'Contents', 'Index', 'About',
789 'right-aligned-cell-1', 'FastForward',
791 'left-aligned-cell-2', 'Back',
792 'center-aligned-cell-1', 'Up',
793 'right-aligned-cell-2', 'Forward'
796 # buttons for misc stuff
797 @Texi2HTML::Config::MISC_BUTTONS = ('center-aligned-cell-3', 'Top', 'Contents', 'Index', 'About');
799 # buttons for chapter file footers
800 # (and headers but only if SECTION_NAVIGATION is false)
801 @Texi2HTML::Config::CHAPTER_BUTTONS =
802 ('left-aligned-cell-1', 'FastBack',
803 'center-aligned-cell-3', 'Top', 'Contents', 'Index', 'About',
804 'right-aligned-cell-1', 'FastForward',
807 # buttons for section file footers
808 @Texi2HTML::Config::SECTION_FOOTER_BUTTONS =
809 ('left-aligned-cell-1', 'FastBack',
810 'center-aligned-cell-3', 'Top', 'Contents', 'Index', 'About',
811 'right-aligned-cell-1', 'FastForward',
813 'left-aligned-cell-2', 'Back',
814 'center-aligned-cell-1', 'Up',
815 'right-aligned-cell-2', 'Forward'
818 @Texi2HTML::Config::NODE_FOOTER_BUTTONS =
819 ('left-aligned-cell-1', 'FastBack',
820 'center-aligned-cell-3', 'Top', 'Contents', 'Index', 'About',
821 'right-aligned-cell-1', 'FastForward',
823 'left-aligned-cell-2', 'Back',
824 'center-aligned-cell-1', 'Up',
825 'right-aligned-cell-2', 'Forward'
832 #############################################################################
834 #############################################################################
836 # For split pages, use index.html as start page!
837 if ($Texi2HTML::Config::SPLIT eq 'section') {
838 $Texi2HTML::Config::TOP_FILE = 'index.html';