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 ### print_lilypond_page_foot -- output of the TOC
20 ### -) External refs are formatted only as "Text of the node" (not as >>see
21 ### "NODE" section "SECTION" in "BOOK"<< like with default texi2html). Also,
22 ### the leading "(book-name)" is removed.
23 ### Implemented by overriding lilypond_external_ref
24 ### -) Navigation bars on top/bottom of the page and between sections are not
25 ### left-aligned, but use a combination of left/center/right aligned table
26 ### cells; For this, I heavily extend the texi2html code to allow for
27 ### differently aligned cells and for multi-line tables);
28 ### Implemented in lilypond_print_navigation
29 ### -) Allow translated section titles: All section titles can be translated,
30 ### the original (English) title is associated with @translationof. This is
31 ### needed, because the file name / anchor is generated from the original
32 ### English title, since otherwise language-autoselection would break with
34 ### Since it is then no longer possible to obtain the file name from the
35 ### section title, I keep a sectionname<=>filename/anchor around and write
36 ### it out to disk at the end of the conversion. This way, xrefs from
37 ### other manuals can simply load that map and retrieve the correct file
38 ### name for the link. Implemented in:
39 ### lilypond_unknown (handling of @translationof)
40 ### split_at_numbered_sections (correct file name, build the map)
41 ### lilypond_finish_out (write out the map to disk)
42 ### lilypond_external_href (load the map, use the correct link target)
45 ### Useful helper functions:
46 ### -) texinfo_file_name($node_name): returns a texinfo-compatible file name
47 ### for the given string $node_name (whitespace trimmed/replaced by -,
48 ### non-standard chars replaced by _xxxx (ascii char code) and forced to
49 ### start with a letter by prepending t_g if necessary)
52 package Texi2HTML::Config;
58 #############################################################################
59 ### SETTINGS FOR TEXI2HTML
60 #############################################################################
62 @Texi2HTML::Config::CSS_REFS = ("lilypond.css");
63 $Texi2HTML::Config::USE_ACCESSKEY = 1;
64 $Texi2HTML::Config::USE_LINKS = 1;
65 $Texi2HTML::Config::USE_REL_REV = 1;
66 $Texi2HTML::Config::element_file_name = \&split_at_numbered_sections;
67 $Texi2HTML::Config::print_element_header = \&lilypond_print_element_header;
68 $Texi2HTML::Config::print_page_foot = \&print_lilypond_page_foot;
69 $Texi2HTML::Config::print_navigation = \&lilypond_print_navigation;
70 $Texi2HTML::Config::external_ref = \&lilypond_external_ref;
71 $Texi2HTML::Config::external_href = \&lilypond_external_href;
72 $Texi2HTML::Config::toc_body = \&lilypond_toc_body;
73 $Texi2HTML::Config::css_lines = \&lilypond_css_lines;
74 $Texi2HTML::Config::init_out = \&lilypond_init_out;
75 $Texi2HTML::Config::unknown = \&lilypond_unknown;
78 my @section_to_filename;
83 #############################################################################
85 #############################################################################
88 $Data::Dumper::Maxdepth = 2;
90 sub print_element_info($)
93 print "~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
94 print "Element: $element\n";
95 print Dumper($element);
102 #############################################################################
104 #############################################################################
106 # Convert a given node name to its proper file name (normalization as explained
107 # in the texinfo manual:
108 # http://www.gnu.org/software/texinfo/manual/texinfo/html_node/HTML-Xref-Node-Name-Expansion.html
109 sub texinfo_file_name($)
113 # File name normalization by texinfo:
114 # 1/2: letters and numbers are left unchanged
115 # 3/4: multiple, leading and trailing whitespace is removed
116 $text = main::normalise_space($text);
117 # 5/6: all remaining spaces are converted to '-', all other 7- or 8-bit
118 # chars are replaced by _xxxx (xxxx=ascii character code)
119 while ($text ne '') {
120 if ($text =~ s/^([A-Za-z0-9]+)//o) { # number or letter stay unchanged
122 } elsif ($text =~ s/^ //o) { # space -> '-'
124 } elsif ($text =~ s/^(.)//o) { # Otherwise use _xxxx (ascii char code)
126 if ( $ccode <= 0xFFFF ) {
127 $result .= sprintf("_%04x", $ccode);
129 $result .= sprintf("__%06x", $ccode);
133 # 7: if name does not begin with a letter, prepend 't_g' (so it starts with a letter)
134 if ($result !~ /^[a-zA-Z]/) {
135 $result = 't_g' . $str;
142 # Load a file containing a nodename<=>filename map (tab-sepatared, i.e.
143 # NODENAME\tFILENAME\tANCHOR
144 # Returns a ref to a hash "Node title" => ["FilenameWithoutExt", "Anchor"]
145 sub load_map_file ($)
149 # TODO: Load and parse the file
151 if (open(XREFFILE, $mapfilename)) {
152 @nodelist = <XREFFILE>;
154 # parse the tab-separated entries and insert them into the map:
155 foreach $node (@nodelist) {
157 my @entries = split(/\t/, $node);
158 if (length (@entries) == 3) {
159 $node_map->{$entries[0]} = [$entries[1], $entries[2]];
161 print STDERR "Invalid entry in the node file $mapfile: $node\n";
165 print STDERR "Unable to load the map file $mapfile\n";
174 #############################################################################
176 #############################################################################
178 # Include our standard CSS file, not hard-coded CSS code directly in the HTML!
179 # For IE, conditionally include the lilypond-ie-fixes.css style sheet
180 sub lilypond_css_lines ($$)
182 my $import_lines = shift;
183 my $rule_lines = shift;
184 return if (defined($CSS_LINES));
185 if (@$rule_lines or @$import_lines)
187 $CSS_LINES = "<style type=\"text/css\">\n<!--\n";
188 $CSS_LINES .= join('',@$import_lines) . "\n" if (@$import_lines);
189 $CSS_LINES .= join('',@$rule_lines) . "\n" if (@$rule_lines);
190 $CSS_LINES .= "-->\n</style>\n";
192 foreach my $ref (@CSS_REFS)
194 $CSS_LINES .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"$ref\">\n";
196 $CSS_LINES .= "<!--[if lte IE 7]>\n<link href=\"lilypond-ie-fixes.css\" rel=\"stylesheet\" type=\"text/css\">\n<![endif]-->\n";
203 #############################################################################
204 ### SPLITTING BASED ON NUMBERED SECTIONS
205 #############################################################################
209 my $node_to_filename_map = ();
211 # This function makes sure that files are only generated for numbered sections,
212 # but not for unnumbered ones. It is called after texi2html has done its own
213 # splitting and simply returns the filename for the node given as first argument
214 # Nodes with the same filename will be printed out to the same filename, so
215 # this really all we need. Also, make sure that the file names for sections
216 # are derived from the section title. We also might want to name the anchors
217 # according to node titles, which works by simply overriding the id element of
218 # the $element hash. Store the file name for each section in a hash (written
219 # out to disk in lilypond_finish_out), so that other manuals can retrieve
220 # the correct filename/anchor from the section title.
221 sub split_at_numbered_sections($$$)
225 my $docu_name = shift;
226 my $docu_ext = $Texi2HTML::Config::EXTENSION;
228 my $node_name = $element->{'node_ref'}->{'no_texi'};
229 if (exists ($node_to_filename_map->{$node_name})) {
230 (my $filename, my $anchor) = @$node_to_filename_map->{$node_name};
231 $filename .= ".$docu_ext" if (defined($docu_ext));
232 print "Stored target: " + $node_to_filename_map->{$node_name};
233 $element->{id} = $anchor;
234 if ($filename == $lastfilename) {
235 $$element{doc_nr} = $docnr;
238 $$element{doc_nr} = $docnr;
239 $lastfilename = $filename;
243 } elsif ($type eq "toc" or $type eq "stoc" or $type eq "foot" or $type eq "about") {
244 # TOC, footer, about etc. are called with undefined $element and $type == "toc"|"stoc"|"foot"|"about"
247 # If we have an entry in the section<=>filename map, use that one, otherwise
248 # generate the filename/anchor here. In the latter case, external manuals
249 # will not be able to retrieve the file name for xrefs!!! Still, I already
250 # had that code, so I'll leave it in in case something goes wrong with the
251 #extract_texi_filenames.py script in the lilypond build process!
252 # TODO: lookup node name in nodename<=>filename map
254 # derive the name of the anchor (i.e. the part after # in the links!),
255 # don't use texi2html's SECx.x default!
256 my $sec_name = main::remove_texi($$element{texi});
257 my $anchor = $sec_name;
258 if ($$element{translationof}) {
259 $anchor = main::remove_texi($$element{translationof});
261 # normalize to the same file name as texinfo
262 $anchor = texinfo_file_name($anchor);
263 $$element{id} = $anchor;
264 # Numbered sections will get a filename Node_title, unnumbered sections will use
265 # the file name of the previous numbered section:
266 if ($$element{number} or $lastfilename == '') {
267 my $filename = $anchor;
268 $filename .= ".$docu_ext" if (defined($docu_ext));
270 $$element{doc_nr} = $docnr;
271 $lastfilename = $filename;
274 $$element{doc_nr} = $docnr;
275 return $lastfilename;
282 sub lilypond_init_out ()
285 t2h_default_init_out ();
286 # my $map_filename = "$Texi2HTML::THISDOC{'destination_directory'}$Texi2HTML::THISDOC{'file_base_name'}_xref.map";
287 my $map_filename = "$Texi2HTML::THISDOC{'file_base_name'}_xref.map";
288 $node_to_filename_map = load_map_file ($map_filename);
289 print Dumper ($node_to_filename_map);
293 #############################################################################
294 ### CLEANER LINK TITLE FOR EXTERNAL REFS
295 #############################################################################
297 # The default formatting of external refs returns e.g.
298 # "(lilypond-internals)Timing_translator", so we remove all (...) from the
299 # file_and_node argument. Also, we want only a very simple format, so we don't
300 # even call the default handler!
301 sub lilypond_external_ref($$$$$$)
306 my $file_node = shift;
308 my $cross_ref = shift;
310 $file_node =~ s/\(.*\)//;
311 $file_node = &$anchor('', $href, $file_node) if ($file_node ne '');
312 return &$I('%{node_file_href}', { 'node_file_href' => $file_node });
314 # Default: format as "see <a ..>NODE</a> section 'SECTION' in BOOK". We don't want this!
315 # return t2h_default_external_ref($type, $section, $book, $file_node, $href, $cross_ref);
322 #############################################################################
323 ### HANDLING TRANSLATED SECTIONS: handle @translationof, secname<->filename
324 ### map stored on disk, xrefs in other manuals load that map
325 #############################################################################
328 # Try to make use of @translationof to generate files according to the original
329 # English section title...
330 sub lilypond_unknown($$$$$)
338 # the @translationof macro provides the original English section title,
339 # which should be used for file/anchor naming, while the title will be
340 # translated to each language
341 if ($pass == 1 and $macro eq "translationof") {
342 if (ref($state->{'element'})=='HASH') {
343 $state->{'element'}->{'translationof'} = main::normalise_space($line);
345 return ('', true, undef, undef);
347 return t2h_default_unknown($macro, $line, $pass, $stack, $state);
354 my %translated_books = ();
355 # Construct a href to an external source of information.
356 # node is the node with texinfo @-commands
357 # node_id is the node transliterated and transformed as explained in the
359 # node_xhtml_id is the node transformed such that it is unique and can
360 # be used to make an html cross ref as explained in the texinfo manual
361 # file is the file in '(file)node'
362 sub lilypond_external_href($$$)
366 my $node_xhtml_id = shift;
368 my $original_func = \&t2h_default_external_href;
371 # 1) Keep a hash of book->section_map
372 # 2) if not file in keys hash => try to load the map (assign empty map is non-existent => will load only once!)
373 # 3) if node in the section=>(file, anchor) map, replace node_id and node_xhtml_id by the map's values
374 # 4) call the t2h_default_external_href with these values (or the old ones if not found)
375 print STDERR "lilypond_external_href: texi_node='$node', node_file='$node_id', node_xhtml_id='$node_xhtml_id', file='$file'\n";
376 if (($node_id ne '') and defined($file)) {
377 if (!exists($translated_books{$file})) {
378 print STDERR "Map for book $file not yet loaded, trying to initialize\n";
379 # TODO: Load the file...
380 $translated_books{$file}={};
382 my $section_name_map = $translated_books{$file};
383 if (exists($section_name_map->{$node_id})) {
384 print STDERR "Found key $node_id in section_name_map\n";
385 # TODO: Assign the new values to $file, $node_id and $node_xhtml_id!
386 # TODO: Am I doing this right?
388 (my $filename, my $anchor) = @$section_name_map->{$node_id};
389 $filename .= ".$docu_ext" if (defined($docu_ext));
390 print "Stored target: " + $node_to_filename_map->{$node_name};
392 $node_xhtml_id = $anchor;
395 print STDERR "Unable to find key $node_id in section_name_map\n";
399 # $file = '' if (!defined($file));
400 # my $default_target_split = $EXTERNAL_CROSSREF_SPLIT;
407 # if ($NEW_CROSSREF_STYLE)
409 # $file =~ s/\.[^\.]*$//;
410 # $file =~ s/^.*\///;
412 # if (exists($Texi2HTML::THISDOC{'htmlxref'}->{$file}))
414 # if (exists($Texi2HTML::THISDOC{'htmlxref'}->{$file}->{'split'}))
417 # $href_split = $Texi2HTML::THISDOC{'htmlxref'}->{$file}->{'split'}->{'href'};
419 # if (exists($Texi2HTML::THISDOC{'htmlxref'}->{$file}->{'mono'}))
422 # $href_mono = $Texi2HTML::THISDOC{'htmlxref'}->{$file}->{'mono'}->{'href'};
426 # if ((not $target_mono) and (not $target_split))
427 # { # nothing specified for that manual, use default
428 # $target_split = $default_target_split;
430 # elsif ($target_split and $target_mono)
431 # { # depends on the splitting of the manual
432 # $target_split = $SPLIT;
434 # elsif ($target_mono)
435 # { # only mono specified
441 # if (defined($href_split))
443 # $file = "$href_split";
445 # elsif (defined($EXTERNAL_DIR))
447 # $file = "$EXTERNAL_DIR/$file";
451 # $file = "../$file";
456 # {# target not split
457 # if (defined($href_mono))
459 # $file = "$href_mono";
463 # if (defined($EXTERNAL_DIR))
465 # $file = "$EXTERNAL_DIR/$file";
469 # $file = "../$file";
471 # $file .= "." . $NODE_FILE_EXTENSION;
478 # if (defined($EXTERNAL_DIR))
480 # $file = $EXTERNAL_DIR . $file;
484 # $file = '../' . $file;
490 # $target_split = $default_target_split;
494 # if ($NEW_CROSSREF_STYLE)
498 # return $file . $TOP_NODE_FILE . '.' . $NODE_FILE_EXTENSION . '#Top';
500 # #return $file . '#Top';
504 # return $file . '#Top';
513 # if ($NEW_CROSSREF_STYLE)
516 # $target = $node_xhtml_id;
520 # $node = main::remove_texi($node);
521 # $node =~ s/[^\w\.\-]/-/g;
523 # my $file_basename = $node;
524 # $file_basename = $TOP_NODE_FILE if ($node =~ /^top$/i);
525 # if ($NEW_CROSSREF_STYLE)
529 # return $file . $file_basename . ".$NODE_FILE_EXTENSION" . '#' . $target;
533 # return $file . '#' . $target;
538 # return $file . $file_basename . ".$NODE_FILE_EXTENSION";
541 return &$original_func($node, $node_id, $node_hxmlt_id, $file);
543 return &$original_func($node, $node_id, $node_hxmlt_id);
551 #############################################################################
552 ### CUSTOM TOC FOR EACH PAGE (in a frame on the left)
553 #############################################################################
555 my $page_toc_depth = 2;
556 my @default_toc = [];
558 # recursively generate the TOC entries for the element and its children (which
559 # are only shown up to maxlevel. All ancestors of the current element are also
560 # shown with their immediate children, irrespective of their level.
561 sub generate_ly_toc_entries($$$$)
564 my $element_path = shift;
565 my $maxlevel = shift;
566 my $always_show_unnumbered_children = shift;
567 # Skip undefined sections, plus all sections generated by index splitting
568 return() if (not defined($element) or exists($element->{'index_page'}));
570 my $level = $element->{'toc_level'};
571 my $is_parent_of_current = $element->{'number'} && $element_path->{$element->{'number'}};
572 my $print_children = ( ($level < $maxlevel) or $is_parent_of_current );
573 my $ind = ' ' x $level;
574 my $this_css_class = $is_parent_of_current ? " class=\"toc_current\"" : "";
576 my $entry = "$ind<li$this_css_class>" . &$anchor ($element->{'tocid'}, "$element->{'file'}#$element->{'id'}",$element->{'text'});
578 my $children = $element->{'section_childs'};
579 # Don't add unnumbered entries, unless they are at top-level or a parent of the current!
580 if (not ($element->{'number'} or $always_show_unnumbered_children)) {
583 if ( $print_children and defined($children) and (ref($children) eq "ARRAY") ) {
584 push (@result, $entry);
585 my @child_result = ();
586 foreach (@$children) {
587 push (@child_result, generate_ly_toc_entries($_, $element_path, $maxlevel, $is_parent_of_current));
589 # if no child nodes were generated, e.g. for the index, where expanded pages
590 # are ignored, don't generate a list at all...
592 push (@result, "$ind<ul$NO_BULLET_LIST_ATTRIBUTE>");
593 push (@result, @child_result);
594 push (@result, "$ind</ul></li>\n");
597 push (@result, $entry . "</li>\n");
603 # Print a customized TOC, containing only the first two levels plus the whole
604 # path to the current page
605 sub lilypond_generate_page_toc_body($)
608 my $current_element = $element;
610 $parentelements{$element->{'number'}} = 1;
611 # Find the path to the current element
612 while ( defined($current_element->{'sectionup'}) and
613 ($current_element->{'sectionup'} ne $current_element) )
615 $parentelements{$current_element->{'sectionup'}->{'number'}} = 1
616 if ($current_element->{'sectionup'}->{'number'} ne '');
617 $current_element = $current_element->{'sectionup'};
619 return () if not defined($current_element);
620 # Create the toc entries recursively
621 my @toc_entries = ("<div class=\"contents\">", "<ul$NO_BULLET_LIST_ATTRIBUTE>");
622 my $children = $current_element->{'section_childs'};
623 foreach ( @$children ) {
624 push (@toc_entries, generate_ly_toc_entries($_, \%parentelements, $page_toc_depth, False));
626 push (@toc_entries, "</ul>");
627 push (@toc_entries, "</div>");
632 # Create the custom TOC for this page (partially folded, current page is
633 # highlighted) and store it in a global variable. The TOC is written out after
634 # the html contents (but positioned correctly using CSS), so that browsers with
635 # css turned off still show the contents first.
636 my @this_page_toc = ();
637 sub lilypond_print_element_header
640 my $first_in_page = shift;
641 my $previous_is_top = shift;
642 if ($first_in_page and not @this_page_toc) {
643 if (defined($Texi2HTML::THIS_ELEMENT)) {
644 # Create the TOC for this page
645 @this_page_toc = lilypond_generate_page_toc_body($Texi2HTML::THIS_ELEMENT);
648 return T2H_DEFAULT_print_element_header( $fh, $first_in_page, $previous_is_top);
651 # Generate the HTML output for the TOC
652 sub lilypond_toc_body($)
654 my $elements_list = shift;
655 # Generate a default TOC for pages without THIS_ELEMENT
656 @default_toc = lilypond_generate_page_toc_body(@$elements_list[0]);
657 return T2H_GPL_toc_body($elements_list);
661 # Print out the TOC in a <div> at the end of th page, which will be formatted as a
662 # sidebar mimicking a TOC frame
663 sub print_lilypond_page_foot($)
666 my $program_string = &$program_string();
667 print $fh "<p><font size='-1'>$program_string</font><br>$PRE_BODY_CLOSE</p>\n";
669 # Print the TOC frame:
670 my @lines = @this_page_toc;
671 # use default TOC if no custom lines have been generated
672 @lines = @default_toc if (not @lines);
674 print $fh "\n\n<div id=\"tocframe\">";
675 print $fh '<h4> ' . $Texi2HTML::NAME{'Contents'} . "</h4>\n";
676 foreach my $line (@lines) {
684 print $fh "</body>\n</html>\n";
691 #############################################################################
692 ### NICER / MORE FLEXIBLE NAVIGATION PANELS
693 #############################################################################
695 sub get_navigation_text
698 my $text = $NAVIGATION_TEXT{$button};
699 if ( ($button eq 'Back') or ($button eq 'FastBack') ) {
700 $text = $text . $Texi2HTML::NODE{$button} . " ";
701 } elsif ( ($button eq 'Forward') or ($button eq 'FastForward') ) {
702 $text = " " . $Texi2HTML::NODE{$button} . $text;
703 } elsif ( $button eq 'Up' ) {
704 $text = " ".$text.": " . $Texi2HTML::NODE{$button} . " ";
710 # Don't automatically create left-aligned table cells for every link, but
711 # instead create a <td> only on an appropriate '(left|right|center)-aligned-cell-n'
712 # button text. It's alignment as well as the colspan will be taken from the
713 # name of the button. Also, add 'newline' button text to create a new table
714 # row. The texts of the buttons are generated by get_navigation_text and
715 # will contain the name of the next/previous section/chapter.
716 sub lilypond_print_navigation
720 my $vertical = shift;
722 # print $fh '<table cellpadding="', $spacing, '" cellspacing="', $spacing,
723 # "\" border=\"0\" class=\"nav_table\">\n";
724 print $fh "<table class=\"nav_table\">\n";
726 print $fh "<tr>" unless $vertical;
728 foreach my $button (@$buttons)
730 print $fh qq{<tr valign="top" align="left">\n} if $vertical;
731 # Allow (left|right|center)-aligned-cell and newline as buttons!
732 if ( $button =~ /^(.*)-aligned-cell-(.*)$/ )
734 print $fh qq{</td>} unless $beginofline;
735 print $fh qq{<td valign="middle" align="$1" colspan="$2">};
738 elsif ( $button eq 'newline' )
740 print $fh qq{</td>} unless $beginofline;
746 elsif (ref($button) eq 'CODE')
748 &$button($fh, $vertical);
750 elsif (ref($button) eq 'SCALAR')
752 print $fh "$$button" if defined($$button);
754 elsif (ref($button) eq 'ARRAY')
756 my $text = $button->[1];
757 my $button_href = $button->[0];
758 # verify that $button_href is simple text and text is a reference
759 if (defined($button_href) and !ref($button_href)
760 and defined($text) and (ref($text) eq 'SCALAR') and defined($$text))
762 if ($Texi2HTML::HREF{$button_href})
764 my $anchor_attributes = '';
765 if ($USE_ACCESSKEY and (defined($BUTTONS_ACCESSKEY{$button_href})) and ($BUTTONS_ACCESSKEY{$button_href} ne ''))
767 $anchor_attributes = "accesskey=\"$BUTTONS_ACCESSKEY{$button_href}\"";
769 if ($USE_REL_REV and (defined($BUTTONS_REL{$button_href})) and ($BUTTONS_REL{$button_href} ne ''))
771 $anchor_attributes .= " rel=\"$BUTTONS_REL{$button_href}\"";
775 $Texi2HTML::HREF{$button_href},
776 get_navigation_text($$text),
782 print $fh get_navigation_text($$text);
786 elsif ($button eq ' ')
787 { # handle space button
789 ($ICONS && $ACTIVE_ICONS{' '}) ?
790 &$button_icon_img($BUTTONS_NAME{$button}, $ACTIVE_ICONS{' '}) :
791 $NAVIGATION_TEXT{' '};
794 elsif ($Texi2HTML::HREF{$button})
796 my $btitle = $BUTTONS_GOTO{$button} ?
797 'title="' . $BUTTONS_GOTO{$button} . '"' : '';
798 if ($USE_ACCESSKEY and (defined($BUTTONS_ACCESSKEY{$button})) and ($BUTTONS_ACCESSKEY{$button} ne ''))
800 $btitle .= " accesskey=\"$BUTTONS_ACCESSKEY{$button}\"";
802 if ($USE_REL_REV and (defined($BUTTONS_REL{$button})) and ($BUTTONS_REL{$button} ne ''))
804 $btitle .= " rel=\"$BUTTONS_REL{$button}\"";
806 if ($ICONS && $ACTIVE_ICONS{$button})
810 $Texi2HTML::HREF{$button},
811 &$button_icon_img($BUTTONS_NAME{$button},
812 $ACTIVE_ICONS{$button},
813 $Texi2HTML::SIMPLE_TEXT{$button}),
822 $Texi2HTML::HREF{$button},
823 get_navigation_text ($button),
830 { # button is passive
832 $ICONS && $PASSIVE_ICONS{$button} ?
833 &$button_icon_img($BUTTONS_NAME{$button},
834 $PASSIVE_ICONS{$button},
835 $Texi2HTML::SIMPLE_TEXT{$button}) :
837 "[" . get_navigation_text($button) . "]";
839 print $fh "</td>\n" if $vertical;
840 print $fh "</tr>\n" if $vertical;
842 print $fh "</td>" unless $beginofline;
843 print $fh "</tr>" unless $vertical;
844 print $fh "</table>\n";
848 @Texi2HTML::Config::SECTION_BUTTONS =
849 ('left-aligned-cell-1', 'FastBack',
850 'center-aligned-cell-3', 'Top', 'Contents', 'Index', 'About',
851 'right-aligned-cell-1', 'FastForward',
853 'left-aligned-cell-2', 'Back',
854 'center-aligned-cell-1', 'Up',
855 'right-aligned-cell-2', 'Forward'
858 # buttons for misc stuff
859 @Texi2HTML::Config::MISC_BUTTONS = ('center-aligned-cell-3', 'Top', 'Contents', 'Index', 'About');
861 # buttons for chapter file footers
862 # (and headers but only if SECTION_NAVIGATION is false)
863 @Texi2HTML::Config::CHAPTER_BUTTONS =
864 ('left-aligned-cell-1', 'FastBack',
865 'center-aligned-cell-3', 'Top', 'Contents', 'Index', 'About',
866 'right-aligned-cell-1', 'FastForward',
869 # buttons for section file footers
870 @Texi2HTML::Config::SECTION_FOOTER_BUTTONS =
871 ('left-aligned-cell-1', 'FastBack',
872 'center-aligned-cell-3', 'Top', 'Contents', 'Index', 'About',
873 'right-aligned-cell-1', 'FastForward',
875 'left-aligned-cell-2', 'Back',
876 'center-aligned-cell-1', 'Up',
877 'right-aligned-cell-2', 'Forward'
880 @Texi2HTML::Config::NODE_FOOTER_BUTTONS =
881 ('left-aligned-cell-1', 'FastBack',
882 'center-aligned-cell-3', 'Top', 'Contents', 'Index', 'About',
883 'right-aligned-cell-1', 'FastForward',
885 'left-aligned-cell-2', 'Back',
886 'center-aligned-cell-1', 'Up',
887 'right-aligned-cell-2', 'Forward'
894 #############################################################################
896 #############################################################################
898 # For split pages, use index.html as start page!
899 if ($Texi2HTML::Config::SPLIT == 'section') {
900 $Texi2HTML::Config::TOP_FILE = 'index.html';