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}) {
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 # Skip undefined sections, plus all sections generated by index splitting
567 return() if (not defined($element) or exists($element->{'index_page'}));
569 my $level = $element->{'toc_level'};
570 my $is_parent_of_current = $element_path->{$element->{'number'}};
571 my $print_children = ( ($level < $maxlevel) or $is_parent_of_current );
572 my $ind = ' ' x $level;
573 my $this_css_class = $is_parent_of_current ? " class=\"toc_current\"" : "";
575 my $entry = "$ind<li$this_css_class>" . &$anchor ($element->{'tocid'}, "$element->{'file'}#$element->{'id'}",$element->{'text'});
577 my $children = $element->{'section_childs'};
578 if ( $print_children and defined($children) and (ref($children) eq "ARRAY") ) {
579 push (@result, $entry);
580 my @child_result = ();
581 foreach (@$children) {
582 push (@child_result, generate_ly_toc_entries($_, $element_path, $maxlevel));
584 # if no child nodes were generated, e.g. for the index, where expanded pages
585 # are ignored, don't generate a list at all...
587 push (@result, "$ind<ul$NO_BULLET_LIST_ATTRIBUTE>");
588 push (@result, @child_result);
589 push (@result, "$ind</ul></li>\n");
592 push (@result, $entry . "</li>\n");
598 # Print a customized TOC, containing only the first two levels plus the whole
599 # path to the current page
600 sub lilypond_generate_page_toc_body($)
603 my $current_element = $element;
605 $parentelements{$element->{'number'}} = 1;
606 # Find the path to the current element
607 while ( defined($current_element->{'sectionup'}) and
608 ($current_element->{'sectionup'} ne $current_element) )
610 $parentelements{$current_element->{'sectionup'}->{'number'}} = 1
611 if ($current_element->{'sectionup'}->{'number'} ne '');
612 $current_element = $current_element->{'sectionup'};
614 return () if not defined($current_element);
615 # Create the toc entries recursively
616 my @toc_entries = ("<div class=\"contents\">", "<ul$NO_BULLET_LIST_ATTRIBUTE>");
617 my $children = $current_element->{'section_childs'};
618 foreach ( @$children ) {
619 push (@toc_entries, generate_ly_toc_entries($_, \%parentelements, $page_toc_depth));
621 push (@toc_entries, "</ul>");
622 push (@toc_entries, "</div>");
627 # Create the custom TOC for this page (partially folded, current page is
628 # highlighted) and store it in a global variable. The TOC is written out after
629 # the html contents (but positioned correctly using CSS), so that browsers with
630 # css turned off still show the contents first.
631 my @this_page_toc = ();
632 sub lilypond_print_element_header
635 my $first_in_page = shift;
636 my $previous_is_top = shift;
637 if ($first_in_page and not @this_page_toc) {
638 if (defined($Texi2HTML::THIS_ELEMENT)) {
639 # Create the TOC for this page
640 @this_page_toc = lilypond_generate_page_toc_body($Texi2HTML::THIS_ELEMENT);
643 return T2H_DEFAULT_print_element_header( $fh, $first_in_page, $previous_is_top);
646 # Generate the HTML output for the TOC
647 sub lilypond_toc_body($)
649 my $elements_list = shift;
650 # Generate a default TOC for pages without THIS_ELEMENT
651 @default_toc = lilypond_generate_page_toc_body(@$elements_list[0]);
652 return T2H_GPL_toc_body($elements_list);
656 # Print out the TOC in a <div> at the end of th page, which will be formatted as a
657 # sidebar mimicking a TOC frame
658 sub print_lilypond_page_foot($)
661 my $program_string = &$program_string();
662 print $fh "<p><font size='-1'>$program_string</font><br>$PRE_BODY_CLOSE</p>\n";
664 # Print the TOC frame:
665 my @lines = @this_page_toc;
666 # use default TOC if no custom lines have been generated
667 @lines = @default_toc if (not @lines);
669 print $fh "\n\n<div id=\"tocframe\">";
670 print $fh '<h4> ' . $Texi2HTML::NAME{'Contents'} . "</h4>\n";
671 foreach my $line (@lines) {
679 print $fh "</body>\n</html>\n";
686 #############################################################################
687 ### NICER / MORE FLEXIBLE NAVIGATION PANELS
688 #############################################################################
690 sub get_navigation_text
693 my $text = $NAVIGATION_TEXT{$button};
694 if ( ($button eq 'Back') or ($button eq 'FastBack') ) {
695 $text = $text . $Texi2HTML::NODE{$button} . " ";
696 } elsif ( ($button eq 'Forward') or ($button eq 'FastForward') ) {
697 $text = " " . $Texi2HTML::NODE{$button} . $text;
698 } elsif ( $button eq 'Up' ) {
699 $text = " ".$text.": " . $Texi2HTML::NODE{$button} . " ";
705 # Don't automatically create left-aligned table cells for every link, but
706 # instead create a <td> only on an appropriate '(left|right|center)-aligned-cell-n'
707 # button text. It's alignment as well as the colspan will be taken from the
708 # name of the button. Also, add 'newline' button text to create a new table
709 # row. The texts of the buttons are generated by get_navigation_text and
710 # will contain the name of the next/previous section/chapter.
711 sub lilypond_print_navigation
715 my $vertical = shift;
717 # print $fh '<table cellpadding="', $spacing, '" cellspacing="', $spacing,
718 # "\" border=\"0\" class=\"nav_table\">\n";
719 print $fh "<table class=\"nav_table\">\n";
721 print $fh "<tr>" unless $vertical;
723 foreach my $button (@$buttons)
725 print $fh qq{<tr valign="top" align="left">\n} if $vertical;
726 # Allow (left|right|center)-aligned-cell and newline as buttons!
727 if ( $button =~ /^(.*)-aligned-cell-(.*)$/ )
729 print $fh qq{</td>} unless $beginofline;
730 print $fh qq{<td valign="middle" align="$1" colspan="$2">};
733 elsif ( $button eq 'newline' )
735 print $fh qq{</td>} unless $beginofline;
741 elsif (ref($button) eq 'CODE')
743 &$button($fh, $vertical);
745 elsif (ref($button) eq 'SCALAR')
747 print $fh "$$button" if defined($$button);
749 elsif (ref($button) eq 'ARRAY')
751 my $text = $button->[1];
752 my $button_href = $button->[0];
753 # verify that $button_href is simple text and text is a reference
754 if (defined($button_href) and !ref($button_href)
755 and defined($text) and (ref($text) eq 'SCALAR') and defined($$text))
757 if ($Texi2HTML::HREF{$button_href})
759 my $anchor_attributes = '';
760 if ($USE_ACCESSKEY and (defined($BUTTONS_ACCESSKEY{$button_href})) and ($BUTTONS_ACCESSKEY{$button_href} ne ''))
762 $anchor_attributes = "accesskey=\"$BUTTONS_ACCESSKEY{$button_href}\"";
764 if ($USE_REL_REV and (defined($BUTTONS_REL{$button_href})) and ($BUTTONS_REL{$button_href} ne ''))
766 $anchor_attributes .= " rel=\"$BUTTONS_REL{$button_href}\"";
770 $Texi2HTML::HREF{$button_href},
771 get_navigation_text($$text),
777 print $fh get_navigation_text($$text);
781 elsif ($button eq ' ')
782 { # handle space button
784 ($ICONS && $ACTIVE_ICONS{' '}) ?
785 &$button_icon_img($BUTTONS_NAME{$button}, $ACTIVE_ICONS{' '}) :
786 $NAVIGATION_TEXT{' '};
789 elsif ($Texi2HTML::HREF{$button})
791 my $btitle = $BUTTONS_GOTO{$button} ?
792 'title="' . $BUTTONS_GOTO{$button} . '"' : '';
793 if ($USE_ACCESSKEY and (defined($BUTTONS_ACCESSKEY{$button})) and ($BUTTONS_ACCESSKEY{$button} ne ''))
795 $btitle .= " accesskey=\"$BUTTONS_ACCESSKEY{$button}\"";
797 if ($USE_REL_REV and (defined($BUTTONS_REL{$button})) and ($BUTTONS_REL{$button} ne ''))
799 $btitle .= " rel=\"$BUTTONS_REL{$button}\"";
801 if ($ICONS && $ACTIVE_ICONS{$button})
805 $Texi2HTML::HREF{$button},
806 &$button_icon_img($BUTTONS_NAME{$button},
807 $ACTIVE_ICONS{$button},
808 $Texi2HTML::SIMPLE_TEXT{$button}),
817 $Texi2HTML::HREF{$button},
818 get_navigation_text ($button),
825 { # button is passive
827 $ICONS && $PASSIVE_ICONS{$button} ?
828 &$button_icon_img($BUTTONS_NAME{$button},
829 $PASSIVE_ICONS{$button},
830 $Texi2HTML::SIMPLE_TEXT{$button}) :
832 "[" . get_navigation_text($button) . "]";
834 print $fh "</td>\n" if $vertical;
835 print $fh "</tr>\n" if $vertical;
837 print $fh "</td>" unless $beginofline;
838 print $fh "</tr>" unless $vertical;
839 print $fh "</table>\n";
843 @Texi2HTML::Config::SECTION_BUTTONS =
844 ('left-aligned-cell-1', 'FastBack',
845 'center-aligned-cell-3', 'Top', 'Contents', 'Index', 'About',
846 'right-aligned-cell-1', 'FastForward',
848 'left-aligned-cell-2', 'Back',
849 'center-aligned-cell-1', 'Up',
850 'right-aligned-cell-2', 'Forward'
853 # buttons for misc stuff
854 @Texi2HTML::Config::MISC_BUTTONS = ('center-aligned-cell-3', 'Top', 'Contents', 'Index', 'About');
856 # buttons for chapter file footers
857 # (and headers but only if SECTION_NAVIGATION is false)
858 @Texi2HTML::Config::CHAPTER_BUTTONS =
859 ('left-aligned-cell-1', 'FastBack',
860 'center-aligned-cell-3', 'Top', 'Contents', 'Index', 'About',
861 'right-aligned-cell-1', 'FastForward',
864 # buttons for section file footers
865 @Texi2HTML::Config::SECTION_FOOTER_BUTTONS =
866 ('left-aligned-cell-1', 'FastBack',
867 'center-aligned-cell-3', 'Top', 'Contents', 'Index', 'About',
868 'right-aligned-cell-1', 'FastForward',
870 'left-aligned-cell-2', 'Back',
871 'center-aligned-cell-1', 'Up',
872 'right-aligned-cell-2', 'Forward'
875 @Texi2HTML::Config::NODE_FOOTER_BUTTONS =
876 ('left-aligned-cell-1', 'FastBack',
877 'center-aligned-cell-3', 'Top', 'Contents', 'Index', 'About',
878 'right-aligned-cell-1', 'FastForward',
880 'left-aligned-cell-2', 'Back',
881 'center-aligned-cell-1', 'Up',
882 'right-aligned-cell-2', 'Forward'
889 #############################################################################
891 #############################################################################
893 # For split pages, use index.html as start page!
894 if ($Texi2HTML::Config::SPLIT == 'section') {
895 $Texi2HTML::Config::TOP_FILE = 'index.html';