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. This way,
36 ### xrefs from other manuals can simply load that map and retrieve the
37 ### correct file name for the link. Implemented in:
38 ### lilypond_unknown (handling of @translationof, in case
39 ### extract_texi_filenames.py messes up...)
40 ### split_at_numbered_sections (correct file name: use the map)
41 ### lilypond_init_out (read in the externally created map from disk)
42 ### lilypond_external_href (load the map for xrefs, use the correct
46 ### Useful helper functions:
47 ### -) texinfo_file_name($node_name): returns a texinfo-compatible file name
48 ### for the given string $node_name (whitespace trimmed/replaced by -,
49 ### non-standard chars replaced by _xxxx (ascii char code) and forced to
50 ### start with a letter by prepending t_g if necessary)
53 package Texi2HTML::Config;
59 #############################################################################
60 ### SETTINGS FOR TEXI2HTML
61 #############################################################################
63 @Texi2HTML::Config::CSS_REFS = ("lilypond.css");
64 $Texi2HTML::Config::USE_ACCESSKEY = 1;
65 $Texi2HTML::Config::USE_LINKS = 1;
66 $Texi2HTML::Config::USE_REL_REV = 1;
67 $Texi2HTML::Config::element_file_name = \&split_at_numbered_sections;
68 $Texi2HTML::Config::print_element_header = \&lilypond_print_element_header;
69 $Texi2HTML::Config::print_page_foot = \&print_lilypond_page_foot;
70 $Texi2HTML::Config::print_navigation = \&lilypond_print_navigation;
71 $Texi2HTML::Config::external_ref = \&lilypond_external_ref;
72 $Texi2HTML::Config::external_href = \&lilypond_external_href;
73 $Texi2HTML::Config::toc_body = \&lilypond_toc_body;
74 $Texi2HTML::Config::css_lines = \&lilypond_css_lines;
75 $Texi2HTML::Config::init_out = \&lilypond_init_out;
76 $Texi2HTML::Config::unknown = \&lilypond_unknown;
79 my @section_to_filename;
84 #############################################################################
86 #############################################################################
89 $Data::Dumper::Maxdepth = 2;
91 sub print_element_info($)
94 print "~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
95 print "Element: $element\n";
96 print Dumper($element);
103 #############################################################################
105 #############################################################################
107 # Convert a given node name to its proper file name (normalization as explained
108 # in the texinfo manual:
109 # http://www.gnu.org/software/texinfo/manual/texinfo/html_node/HTML-Xref-Node-Name-Expansion.html
110 sub texinfo_file_name($)
114 # File name normalization by texinfo:
115 # 1/2: letters and numbers are left unchanged
116 # 3/4: multiple, leading and trailing whitespace is removed
117 $text = main::normalise_space($text);
118 # 5/6: all remaining spaces are converted to '-', all other 7- or 8-bit
119 # chars are replaced by _xxxx (xxxx=ascii character code)
120 while ($text ne '') {
121 if ($text =~ s/^([A-Za-z0-9]+)//o) { # number or letter stay unchanged
123 } elsif ($text =~ s/^ //o) { # space -> '-'
125 } elsif ($text =~ s/^(.)//o) { # Otherwise use _xxxx (ascii char code)
127 if ( $ccode <= 0xFFFF ) {
128 $result .= sprintf("_%04x", $ccode);
130 $result .= sprintf("__%06x", $ccode);
134 # 7: if name does not begin with a letter, prepend 't_g' (so it starts with a letter)
135 if ($result !~ /^[a-zA-Z]/) {
136 $result = 't_g' . $str;
143 # Load a file containing a nodename<=>filename map (tab-sepatared, i.e.
144 # NODENAME\tFILENAME\tANCHOR
145 # Returns a ref to a hash "Node title" => ["FilenameWithoutExt", "Anchor"]
146 sub load_map_file ($)
150 # TODO: Load and parse the file
152 if (open(XREFFILE, $mapfilename)) {
153 @nodelist = <XREFFILE>;
155 # parse the tab-separated entries and insert them into the map:
156 foreach $node (@nodelist) {
158 my @entries = split(/\t/, $node);
159 if (length (@entries) == 3) {
160 $node_map->{$entries[0]} = [$entries[1], $entries[2]];
162 print STDERR "Invalid entry in the node file $mapfile: $node\n";
166 print STDERR "Unable to load the map file $mapfile\n";
175 #############################################################################
177 #############################################################################
179 # Include our standard CSS file, not hard-coded CSS code directly in the HTML!
180 # For IE, conditionally include the lilypond-ie-fixes.css style sheet
181 sub lilypond_css_lines ($$)
183 my $import_lines = shift;
184 my $rule_lines = shift;
185 return if (defined($CSS_LINES));
186 if (@$rule_lines or @$import_lines)
188 $CSS_LINES = "<style type=\"text/css\">\n<!--\n";
189 $CSS_LINES .= join('',@$import_lines) . "\n" if (@$import_lines);
190 $CSS_LINES .= join('',@$rule_lines) . "\n" if (@$rule_lines);
191 $CSS_LINES .= "-->\n</style>\n";
193 foreach my $ref (@CSS_REFS)
195 $CSS_LINES .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"$ref\">\n";
197 $CSS_LINES .= "<!--[if lte IE 7]>\n<link href=\"lilypond-ie-fixes.css\" rel=\"stylesheet\" type=\"text/css\">\n<![endif]-->\n";
204 #############################################################################
205 ### SPLITTING BASED ON NUMBERED SECTIONS
206 #############################################################################
210 my $node_to_filename_map = ();
212 # This function makes sure that files are only generated for numbered sections,
213 # but not for unnumbered ones. It is called after texi2html has done its own
214 # splitting and simply returns the filename for the node given as first argument
215 # Nodes with the same filename will be printed out to the same filename, so
216 # this really all we need. Also, make sure that the file names for sections
217 # are derived from the section title. We also might want to name the anchors
218 # according to node titles, which works by simply overriding the id element of
220 # If an external nodename<=>filename/anchor map file is found (loaded in
221 # lilypond_init_out, use the externally created values, otherwise use the
223 sub split_at_numbered_sections($$$)
227 my $docu_name = shift;
228 my $docu_ext = $Texi2HTML::Config::EXTENSION;
230 my $node_name = $element->{'node_ref'}->{'no_texi'};
231 if (exists ($node_to_filename_map->{$node_name})) {
232 (my $filename, my $anchor) = @$node_to_filename_map->{$node_name};
233 $filename .= ".$docu_ext" if (defined($docu_ext));
234 print "Stored target: " + $node_to_filename_map->{$node_name};
235 $element->{id} = $anchor;
236 if ($filename == $lastfilename) {
237 $$element{doc_nr} = $docnr;
240 $$element{doc_nr} = $docnr;
241 $lastfilename = $filename;
245 } elsif ($type eq "top" or $type eq "toc" or $type eq "stoc" or $type eq "foot" or $type eq "about") {
246 # TOC, footer, about etc. are called with undefined $element and $type == "toc"|"stoc"|"foot"|"about"
249 # If we have an entry in the section<=>filename map, use that one, otherwise
250 # generate the filename/anchor here. In the latter case, external manuals
251 # will not be able to retrieve the file name for xrefs!!! Still, I already
252 # had that code, so I'll leave it in in case something goes wrong with the
253 #extract_texi_filenames.py script in the lilypond build process!
254 # TODO: lookup node name in nodename<=>filename map
256 # derive the name of the anchor (i.e. the part after # in the links!),
257 # don't use texi2html's SECx.x default!
259 my $sec_name = main::remove_texi($element->{'texi'});
260 if ($element->{'node_ref'}->{'texi'} ne '') { # if we have a node, use its name:
261 $sec_name = main::remove_texi($element->{'node_ref'}->{'texi'});
263 my $anchor = $sec_name;
264 if ($$element{translationof}) {
265 $anchor = main::remove_texi($$element{translationof});
267 # normalize to the same file name as texinfo
268 $anchor = texinfo_file_name($anchor);
269 $$element{id} = $anchor;
270 # Numbered sections will get a filename Node_title, unnumbered sections will use
271 # the file name of the previous numbered section:
272 if (($element->{number}) or ($lastfilename eq '')) {
273 my $filename = $anchor;
274 $filename .= ".$docu_ext" if (defined($docu_ext));
276 $$element{doc_nr} = $docnr;
277 $lastfilename = $filename;
280 $$element{doc_nr} = $docnr;
281 return $lastfilename;
288 sub lilypond_init_out ()
291 t2h_default_init_out ();
292 # my $map_filename = "$Texi2HTML::THISDOC{'destination_directory'}$Texi2HTML::THISDOC{'file_base_name'}_xref.map";
293 my $map_filename = "$Texi2HTML::THISDOC{'file_base_name'}_xref.map";
294 $node_to_filename_map = load_map_file ($map_filename);
295 print Dumper ($node_to_filename_map);
299 #############################################################################
300 ### CLEANER LINK TITLE FOR EXTERNAL REFS
301 #############################################################################
303 # The default formatting of external refs returns e.g.
304 # "(lilypond-internals)Timing_translator", so we remove all (...) from the
305 # file_and_node argument. Also, we want only a very simple format, so we don't
306 # even call the default handler!
307 sub lilypond_external_ref($$$$$$)
312 my $file_node = shift;
314 my $cross_ref = shift;
316 $file_node =~ s/\(.*\)//;
317 $file_node = &$anchor('', $href, $file_node) if ($file_node ne '');
318 return &$I('%{node_file_href}', { 'node_file_href' => $file_node });
320 # Default: format as "see <a ..>NODE</a> section 'SECTION' in BOOK". We don't want this!
321 # return t2h_default_external_ref($type, $section, $book, $file_node, $href, $cross_ref);
328 #############################################################################
329 ### HANDLING TRANSLATED SECTIONS: handle @translationof, secname<->filename
330 ### map stored on disk, xrefs in other manuals load that map
331 #############################################################################
334 # Try to make use of @translationof to generate files according to the original
335 # English section title...
336 sub lilypond_unknown($$$$$)
344 # the @translationof macro provides the original English section title,
345 # which should be used for file/anchor naming, while the title will be
346 # translated to each language
347 # It is already used by extract_texi_filenames.py, so this should not be
348 # necessary here at all. Still, I'll leave the code in just in case the
349 # python script messed up ;-)
350 if ($pass == 1 and $macro eq "translationof") {
351 if (ref($state->{'element'})=='HASH') {
352 $state->{'element'}->{'translationof'} = main::normalise_space($line);
354 return ('', true, undef, undef);
356 return t2h_default_unknown($macro, $line, $pass, $stack, $state);
363 my %translated_books = ();
364 # Construct a href to an external source of information.
365 # node is the node with texinfo @-commands
366 # node_id is the node transliterated and transformed as explained in the
368 # node_xhtml_id is the node transformed such that it is unique and can
369 # be used to make an html cross ref as explained in the texinfo manual
370 # file is the file in '(file)node'
371 sub lilypond_external_href($$$)
375 my $node_xhtml_id = shift;
377 my $original_func = \&t2h_default_external_href;
380 # 1) Keep a hash of book->section_map
381 # 2) if not file in keys hash => try to load the map (assign empty map is non-existent => will load only once!)
382 # 3) if node in the section=>(file, anchor) map, replace node_id and node_xhtml_id by the map's values
383 # 4) call the t2h_default_external_href with these values (or the old ones if not found)
384 print STDERR "lilypond_external_href: texi_node='$node', node_file='$node_id', node_xhtml_id='$node_xhtml_id', file='$file'\n";
385 if (($node_id ne '') and defined($file)) {
386 if (!exists($translated_books{$file})) {
387 print STDERR "Map for book $file not yet loaded, trying to initialize\n";
388 # TODO: Load the file...
389 $translated_books{$file}={};
391 my $section_name_map = $translated_books{$file};
392 if (exists($section_name_map->{$node_id})) {
393 print STDERR "Found key $node_id in section_name_map\n";
394 # TODO: Assign the new values to $file, $node_id and $node_xhtml_id!
395 # TODO: Am I doing this right?
397 (my $filename, my $anchor) = @$section_name_map->{$node_id};
398 $filename .= ".$docu_ext" if (defined($docu_ext));
399 print "Stored target: " + $node_to_filename_map->{$node_name};
401 $node_xhtml_id = $anchor;
404 print STDERR "Unable to find key $node_id in section_name_map\n";
407 # Code copied from texi2html:
408 # I'll need to find the correct path to the map file and texi2html already
409 # seems to do a good job for this with the following code, which I will
410 # need to strip down to those parts that we really need:
412 # $file = '' if (!defined($file));
413 # my $default_target_split = $EXTERNAL_CROSSREF_SPLIT;
420 # if ($NEW_CROSSREF_STYLE)
422 # $file =~ s/\.[^\.]*$//;
423 # $file =~ s/^.*\///;
425 # if (exists($Texi2HTML::THISDOC{'htmlxref'}->{$file}))
427 # if (exists($Texi2HTML::THISDOC{'htmlxref'}->{$file}->{'split'}))
430 # $href_split = $Texi2HTML::THISDOC{'htmlxref'}->{$file}->{'split'}->{'href'};
432 # if (exists($Texi2HTML::THISDOC{'htmlxref'}->{$file}->{'mono'}))
435 # $href_mono = $Texi2HTML::THISDOC{'htmlxref'}->{$file}->{'mono'}->{'href'};
439 # if ((not $target_mono) and (not $target_split))
440 # { # nothing specified for that manual, use default
441 # $target_split = $default_target_split;
443 # elsif ($target_split and $target_mono)
444 # { # depends on the splitting of the manual
445 # $target_split = $SPLIT;
447 # elsif ($target_mono)
448 # { # only mono specified
454 # if (defined($href_split))
456 # $file = "$href_split";
458 # elsif (defined($EXTERNAL_DIR))
460 # $file = "$EXTERNAL_DIR/$file";
464 # $file = "../$file";
469 # {# target not split
470 # if (defined($href_mono))
472 # $file = "$href_mono";
476 # if (defined($EXTERNAL_DIR))
478 # $file = "$EXTERNAL_DIR/$file";
482 # $file = "../$file";
484 # $file .= "." . $NODE_FILE_EXTENSION;
491 # if (defined($EXTERNAL_DIR))
493 # $file = $EXTERNAL_DIR . $file;
497 # $file = '../' . $file;
503 # $target_split = $default_target_split;
507 # if ($NEW_CROSSREF_STYLE)
511 # return $file . $TOP_NODE_FILE . '.' . $NODE_FILE_EXTENSION . '#Top';
513 # #return $file . '#Top';
517 # return $file . '#Top';
526 # if ($NEW_CROSSREF_STYLE)
529 # $target = $node_xhtml_id;
533 # $node = main::remove_texi($node);
534 # $node =~ s/[^\w\.\-]/-/g;
536 # my $file_basename = $node;
537 # $file_basename = $TOP_NODE_FILE if ($node =~ /^top$/i);
538 # if ($NEW_CROSSREF_STYLE)
542 # return $file . $file_basename . ".$NODE_FILE_EXTENSION" . '#' . $target;
546 # return $file . '#' . $target;
551 # return $file . $file_basename . ".$NODE_FILE_EXTENSION";
554 return &$original_func($node, $node_id, $node_hxmlt_id, $file);
556 return &$original_func($node, $node_id, $node_hxmlt_id);
564 #############################################################################
565 ### CUSTOM TOC FOR EACH PAGE (in a frame on the left)
566 #############################################################################
568 my $page_toc_depth = 2;
569 my @default_toc = [];
571 # recursively generate the TOC entries for the element and its children (which
572 # are only shown up to maxlevel. All ancestors of the current element are also
573 # shown with their immediate children, irrespective of their level.
574 # Unnumbered entries are only printed out if they are at top-level or their
575 # parent element is an ancestor of the currently viewed node.
576 sub generate_ly_toc_entries($$$$)
579 my $element_path = shift;
580 my $maxlevel = shift;
581 my $always_show_unnumbered_children = shift;
582 # Skip undefined sections, plus all sections generated by index splitting
583 return() if (not defined($element) or exists($element->{'index_page'}));
585 my $level = $element->{'toc_level'};
586 my $is_parent_of_current = $element->{'number'} && $element_path->{$element->{'number'}};
587 my $print_children = ( ($level < $maxlevel) or $is_parent_of_current );
588 my $ind = ' ' x $level;
589 my $this_css_class = $is_parent_of_current ? " class=\"toc_current\"" : "";
591 my $entry = "$ind<li$this_css_class>" . &$anchor ($element->{'tocid'}, "$element->{'file'}#$element->{'id'}",$element->{'text'});
593 my $children = $element->{'section_childs'};
594 # Don't add unnumbered entries, unless they are at top-level or a parent of the current!
595 if (not ($element->{'number'} or $always_show_unnumbered_children)) {
598 if ( $print_children and defined($children) and (ref($children) eq "ARRAY") ) {
599 push (@result, $entry);
600 my @child_result = ();
601 foreach (@$children) {
602 push (@child_result, generate_ly_toc_entries($_, $element_path, $maxlevel, $is_parent_of_current));
604 # if no child nodes were generated, e.g. for the index, where expanded pages
605 # are ignored, don't generate a list at all...
607 push (@result, "$ind<ul$NO_BULLET_LIST_ATTRIBUTE>");
608 push (@result, @child_result);
609 push (@result, "$ind</ul></li>\n");
612 push (@result, $entry . "</li>\n");
618 # Print a customized TOC, containing only the first two levels plus the whole
619 # path to the current page
620 sub lilypond_generate_page_toc_body($)
623 my $current_element = $element;
625 $parentelements{$element->{'number'}} = 1;
626 # Find the path to the current element
627 while ( defined($current_element->{'sectionup'}) and
628 ($current_element->{'sectionup'} ne $current_element) )
630 $parentelements{$current_element->{'sectionup'}->{'number'}} = 1
631 if ($current_element->{'sectionup'}->{'number'} ne '');
632 $current_element = $current_element->{'sectionup'};
634 return () if not defined($current_element);
635 # Create the toc entries recursively
636 my @toc_entries = ("<div class=\"contents\">", "<ul$NO_BULLET_LIST_ATTRIBUTE>");
637 my $children = $current_element->{'section_childs'};
638 foreach ( @$children ) {
639 push (@toc_entries, generate_ly_toc_entries($_, \%parentelements, $page_toc_depth, False));
641 push (@toc_entries, "</ul>");
642 push (@toc_entries, "</div>");
647 # Create the custom TOC for this page (partially folded, current page is
648 # highlighted) and store it in a global variable. The TOC is written out after
649 # the html contents (but positioned correctly using CSS), so that browsers with
650 # css turned off still show the contents first.
651 my @this_page_toc = ();
652 sub lilypond_print_element_header
655 my $first_in_page = shift;
656 my $previous_is_top = shift;
657 if ($first_in_page and not @this_page_toc) {
658 if (defined($Texi2HTML::THIS_ELEMENT)) {
659 # Create the TOC for this page
660 @this_page_toc = lilypond_generate_page_toc_body($Texi2HTML::THIS_ELEMENT);
663 return T2H_DEFAULT_print_element_header( $fh, $first_in_page, $previous_is_top);
666 # Generate the HTML output for the TOC
667 sub lilypond_toc_body($)
669 my $elements_list = shift;
670 # Generate a default TOC for pages without THIS_ELEMENT
671 @default_toc = lilypond_generate_page_toc_body(@$elements_list[0]);
672 return T2H_GPL_toc_body($elements_list);
676 # Print out the TOC in a <div> at the end of th page, which will be formatted as a
677 # sidebar mimicking a TOC frame
678 sub print_lilypond_page_foot($)
681 my $program_string = &$program_string();
682 print $fh "<p><font size='-1'>$program_string</font><br>$PRE_BODY_CLOSE</p>\n";
684 # Print the TOC frame:
685 my @lines = @this_page_toc;
686 # use default TOC if no custom lines have been generated
687 @lines = @default_toc if (not @lines);
689 print $fh "\n\n<div id=\"tocframe\">";
690 print $fh '<h4> ' . $Texi2HTML::NAME{'Contents'} . "</h4>\n";
691 foreach my $line (@lines) {
699 print $fh "</body>\n</html>\n";
706 #############################################################################
707 ### NICER / MORE FLEXIBLE NAVIGATION PANELS
708 #############################################################################
710 sub get_navigation_text
713 my $text = $NAVIGATION_TEXT{$button};
714 if ( ($button eq 'Back') or ($button eq 'FastBack') ) {
715 $text = $text . $Texi2HTML::NODE{$button} . " ";
716 } elsif ( ($button eq 'Forward') or ($button eq 'FastForward') ) {
717 $text = " " . $Texi2HTML::NODE{$button} . $text;
718 } elsif ( $button eq 'Up' ) {
719 $text = " ".$text.": " . $Texi2HTML::NODE{$button} . " ";
725 # Don't automatically create left-aligned table cells for every link, but
726 # instead create a <td> only on an appropriate '(left|right|center)-aligned-cell-n'
727 # button text. It's alignment as well as the colspan will be taken from the
728 # name of the button. Also, add 'newline' button text to create a new table
729 # row. The texts of the buttons are generated by get_navigation_text and
730 # will contain the name of the next/previous section/chapter.
731 sub lilypond_print_navigation
735 my $vertical = shift;
737 # print $fh '<table cellpadding="', $spacing, '" cellspacing="', $spacing,
738 # "\" border=\"0\" class=\"nav_table\">\n";
739 print $fh "<table class=\"nav_table\">\n";
741 print $fh "<tr>" unless $vertical;
743 foreach my $button (@$buttons)
745 print $fh qq{<tr valign="top" align="left">\n} if $vertical;
746 # Allow (left|right|center)-aligned-cell and newline as buttons!
747 if ( $button =~ /^(.*)-aligned-cell-(.*)$/ )
749 print $fh qq{</td>} unless $beginofline;
750 print $fh qq{<td valign="middle" align="$1" colspan="$2">};
753 elsif ( $button eq 'newline' )
755 print $fh qq{</td>} unless $beginofline;
761 elsif (ref($button) eq 'CODE')
763 &$button($fh, $vertical);
765 elsif (ref($button) eq 'SCALAR')
767 print $fh "$$button" if defined($$button);
769 elsif (ref($button) eq 'ARRAY')
771 my $text = $button->[1];
772 my $button_href = $button->[0];
773 # verify that $button_href is simple text and text is a reference
774 if (defined($button_href) and !ref($button_href)
775 and defined($text) and (ref($text) eq 'SCALAR') and defined($$text))
777 if ($Texi2HTML::HREF{$button_href})
779 my $anchor_attributes = '';
780 if ($USE_ACCESSKEY and (defined($BUTTONS_ACCESSKEY{$button_href})) and ($BUTTONS_ACCESSKEY{$button_href} ne ''))
782 $anchor_attributes = "accesskey=\"$BUTTONS_ACCESSKEY{$button_href}\"";
784 if ($USE_REL_REV and (defined($BUTTONS_REL{$button_href})) and ($BUTTONS_REL{$button_href} ne ''))
786 $anchor_attributes .= " rel=\"$BUTTONS_REL{$button_href}\"";
790 $Texi2HTML::HREF{$button_href},
791 get_navigation_text($$text),
797 print $fh get_navigation_text($$text);
801 elsif ($button eq ' ')
802 { # handle space button
804 ($ICONS && $ACTIVE_ICONS{' '}) ?
805 &$button_icon_img($BUTTONS_NAME{$button}, $ACTIVE_ICONS{' '}) :
806 $NAVIGATION_TEXT{' '};
809 elsif ($Texi2HTML::HREF{$button})
811 my $btitle = $BUTTONS_GOTO{$button} ?
812 'title="' . $BUTTONS_GOTO{$button} . '"' : '';
813 if ($USE_ACCESSKEY and (defined($BUTTONS_ACCESSKEY{$button})) and ($BUTTONS_ACCESSKEY{$button} ne ''))
815 $btitle .= " accesskey=\"$BUTTONS_ACCESSKEY{$button}\"";
817 if ($USE_REL_REV and (defined($BUTTONS_REL{$button})) and ($BUTTONS_REL{$button} ne ''))
819 $btitle .= " rel=\"$BUTTONS_REL{$button}\"";
821 if ($ICONS && $ACTIVE_ICONS{$button})
825 $Texi2HTML::HREF{$button},
826 &$button_icon_img($BUTTONS_NAME{$button},
827 $ACTIVE_ICONS{$button},
828 $Texi2HTML::SIMPLE_TEXT{$button}),
837 $Texi2HTML::HREF{$button},
838 get_navigation_text ($button),
845 { # button is passive
847 $ICONS && $PASSIVE_ICONS{$button} ?
848 &$button_icon_img($BUTTONS_NAME{$button},
849 $PASSIVE_ICONS{$button},
850 $Texi2HTML::SIMPLE_TEXT{$button}) :
852 "[" . get_navigation_text($button) . "]";
854 print $fh "</td>\n" if $vertical;
855 print $fh "</tr>\n" if $vertical;
857 print $fh "</td>" unless $beginofline;
858 print $fh "</tr>" unless $vertical;
859 print $fh "</table>\n";
863 @Texi2HTML::Config::SECTION_BUTTONS =
864 ('left-aligned-cell-1', 'FastBack',
865 'center-aligned-cell-3', 'Top', 'Contents', 'Index', 'About',
866 'right-aligned-cell-1', 'FastForward',
868 'left-aligned-cell-2', 'Back',
869 'center-aligned-cell-1', 'Up',
870 'right-aligned-cell-2', 'Forward'
873 # buttons for misc stuff
874 @Texi2HTML::Config::MISC_BUTTONS = ('center-aligned-cell-3', 'Top', 'Contents', 'Index', 'About');
876 # buttons for chapter file footers
877 # (and headers but only if SECTION_NAVIGATION is false)
878 @Texi2HTML::Config::CHAPTER_BUTTONS =
879 ('left-aligned-cell-1', 'FastBack',
880 'center-aligned-cell-3', 'Top', 'Contents', 'Index', 'About',
881 'right-aligned-cell-1', 'FastForward',
884 # buttons for section file footers
885 @Texi2HTML::Config::SECTION_FOOTER_BUTTONS =
886 ('left-aligned-cell-1', 'FastBack',
887 'center-aligned-cell-3', 'Top', 'Contents', 'Index', 'About',
888 'right-aligned-cell-1', 'FastForward',
890 'left-aligned-cell-2', 'Back',
891 'center-aligned-cell-1', 'Up',
892 'right-aligned-cell-2', 'Forward'
895 @Texi2HTML::Config::NODE_FOOTER_BUTTONS =
896 ('left-aligned-cell-1', 'FastBack',
897 'center-aligned-cell-3', 'Top', 'Contents', 'Index', 'About',
898 'right-aligned-cell-1', 'FastForward',
900 'left-aligned-cell-2', 'Back',
901 'center-aligned-cell-1', 'Up',
902 'right-aligned-cell-2', 'Forward'
909 #############################################################################
911 #############################################################################
913 # For split pages, use index.html as start page!
914 if ($Texi2HTML::Config::SPLIT == 'section') {
915 $Texi2HTML::Config::TOP_FILE = 'index.html';