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 overflown <div>
16 ### is added 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
47 ### -) The HTML anchors for all sections are derived from the node name /
48 ### section title (pre-generated in the .xref-map file). Implemented by:
49 ### split_at_numbered_sections (adjust section anchors)
52 ### Useful helper functions:
53 ### -) texinfo_file_name($node_name): returns a texinfo-compatible file name
54 ### for the given string $node_name (whitespace trimmed/replaced by -,
55 ### non-standard chars replaced by _xxxx (ascii char code) and forced to
56 ### start with a letter by prepending t_g if necessary)
59 package Texi2HTML::Config;
65 #############################################################################
66 ### SETTINGS FOR TEXI2HTML
67 #############################################################################
69 @Texi2HTML::Config::CSS_REFS = ("lilypond.css");
70 $Texi2HTML::Config::USE_ACCESSKEY = 1;
71 $Texi2HTML::Config::USE_LINKS = 1;
72 $Texi2HTML::Config::USE_REL_REV = 1;
73 $Texi2HTML::Config::element_file_name = \&split_at_numbered_sections;
74 $Texi2HTML::Config::print_element_header = \&lilypond_print_element_header;
75 $Texi2HTML::Config::print_page_foot = \&print_lilypond_page_foot;
76 $Texi2HTML::Config::print_navigation = \&lilypond_print_navigation;
77 $Texi2HTML::Config::external_ref = \&lilypond_external_ref;
78 $Texi2HTML::Config::external_href = \&lilypond_external_href;
79 $Texi2HTML::Config::toc_body = \&lilypond_toc_body;
80 $Texi2HTML::Config::css_lines = \&lilypond_css_lines;
81 $Texi2HTML::Config::unknown = \&lilypond_unknown;
82 $Texi2HTML::Config::print_page_head = \&lilypond_print_page_head;
84 # Examples should be formatted similar to quotes:
85 $Texi2HTML::Config::complex_format_map->{'example'} = {
86 'begin' => q{"<blockquote><pre class=\"example\">"},
87 'end' => q{"</pre></blockquote>\n"},
91 my @section_to_filename;
96 #############################################################################
98 #############################################################################
101 $Data::Dumper::Maxdepth = 2;
103 sub print_element_info($)
106 print "~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
107 print "Element: $element\n";
108 print Dumper($element);
115 #############################################################################
117 #############################################################################
119 # Convert a given node name to its proper file name (normalization as explained
120 # in the texinfo manual:
121 # http://www.gnu.org/software/texinfo/manual/texinfo/html_node/HTML-Xref-Node-Name-Expansion.html
122 sub texinfo_file_name($)
126 # File name normalization by texinfo:
127 # 1/2: letters and numbers are left unchanged
128 # 3/4: multiple, leading and trailing whitespace is removed
129 $text = main::normalise_space($text);
130 # 5/6: all remaining spaces are converted to '-', all other 7- or 8-bit
131 # chars are replaced by _xxxx (xxxx=ascii character code)
132 while ($text ne '') {
133 if ($text =~ s/^([A-Za-z0-9]+)//o) { # number or letter stay unchanged
135 } elsif ($text =~ s/^ //o) { # space -> '-'
137 } elsif ($text =~ s/^(.)//o) { # Otherwise use _xxxx (ascii char code)
139 if ( $ccode <= 0xFFFF ) {
140 $result .= sprintf("_%04x", $ccode);
142 $result .= sprintf("__%06x", $ccode);
146 # 7: if name does not begin with a letter, prepend 't_g' (so it starts with a letter)
147 if ($result !~ /^[a-zA-Z]/) {
148 $result = 't_g' . $result;
155 # Load a file containing a nodename<=>filename map (tab-sepatared, i.e.
156 # NODENAME\tFILENAME\tANCHOR
157 # Returns a ref to a hash "Node title" => ["FilenameWithoutExt", "Anchor"]
158 sub load_map_file ($)
163 if (open(XREFFILE, $mapfile)) {
165 while ( $line = <XREFFILE> ) {
166 # parse the tab-separated entries and insert them into the map:
168 my @entries = split(/\t/, $line);
169 if (scalar (@entries) == 3) {
170 $node_map->{$entries[0]} = [$entries[1], $entries[2]];
172 print STDERR "Invalid entry in the node file $mapfile: $line\n";
177 print STDERR "WARNING: Unable to load the map file $mapfile\n";
183 # Split the given path into dir and basename (with .texi removed). Used mainly
184 # to get the path/basename of the original texi input file
185 sub split_texi_filename ($)
188 my $docu_dir, $docu_name;
189 if ($docu =~ /(.*\/)/) {
190 chop($docu_dir = $1);
192 $docu_name =~ s/.*\///;
197 $docu_name =~ s/\.te?x(i|info)?$//;
198 return ($docu_dir, $docu_name);
205 #############################################################################
207 #############################################################################
209 # Include our standard CSS file, not hard-coded CSS code directly in the HTML!
210 # For IE, conditionally include the lilypond-ie-fixes.css style sheet
211 sub lilypond_css_lines ($$)
213 my $import_lines = shift;
214 my $rule_lines = shift;
215 return if (defined($CSS_LINES));
216 if (@$rule_lines or @$import_lines)
218 $CSS_LINES = "<style type=\"text/css\">\n<!--\n";
219 $CSS_LINES .= join('',@$import_lines) . "\n" if (@$import_lines);
220 $CSS_LINES .= join('',@$rule_lines) . "\n" if (@$rule_lines);
221 $CSS_LINES .= "-->\n</style>\n";
223 foreach my $ref (@CSS_REFS)
225 $CSS_LINES .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"$ref\">\n";
227 $CSS_LINES .= "<!--[if lte IE 7]>\n<link href=\"lilypond-ie-fixes.css\" rel=\"stylesheet\" type=\"text/css\">\n<![endif]-->\n";
234 #############################################################################
235 ### SPLITTING BASED ON NUMBERED SECTIONS
236 #############################################################################
240 my $node_to_filename_map = ();
243 # This function makes sure that files are only generated for numbered sections,
244 # but not for unnumbered ones. It is called after texi2html has done its own
245 # splitting and simply returns the filename for the node given as first argument
246 # Nodes with the same filename will be printed out to the same filename, so
247 # this really all we need. Also, make sure that the file names for sections
248 # are derived from the section title. We also might want to name the anchors
249 # according to node titles, which works by simply overriding the id element of
251 # If an external nodename<=>filename/anchor map file is found (loaded in
252 # lilypond_init_out, use the externally created values, otherwise use the
254 sub split_at_numbered_sections($$$)
258 my $docu_name = shift;
259 my $docu_ext = $Texi2HTML::Config::EXTENSION;
261 my $node_name = main::remove_texi($element->{'node_ref'}->{'texi'});
262 # the snippets page does not use nodes for the snippets, so in this case
263 # we'll have to use the section name!
264 if ($node_name eq '') {
265 $node_name = main::remove_texi($element->{'texi'});
268 # If we have an entry in the section<=>filename map, use that one, otherwise
269 # generate the filename/anchor here. In the latter case, external manuals
270 # will not be able to retrieve the file name for xrefs!!! Still, I already
271 # had that code, so I'll leave it in in case something goes wrong with the
272 # extract_texi_filenames.py script in the lilypond build process!
273 if (exists ($node_to_filename_map->{$node_name})) {
274 (my $filename, my $anchor) = @{$node_to_filename_map->{$node_name}};
275 $filename .= ".$docu_ext" if (defined($docu_ext));
277 # need to override both target (used as anchor in links to this section) and
278 # id (used in the <a name=..> tag for this section)!
279 $element->{'id'} = $element->{'target'} = $anchor;
281 # unnumbered sections (except those at top-level!) always go to the same
282 # file as the previous numbered section
283 if (not ($element->{number}) and not ($lastfilename eq '') and ($element->{level} > 1)) {
284 $filename = $lastfilename;
286 if (($filename eq $lastfilename)) {
287 $$element{doc_nr} = $docnr;
290 $$element{doc_nr} = $docnr;
291 $lastfilename = $filename;
295 } elsif ($type eq "top" or $type eq "toc" or $type eq "doc" or $type eq "stoc" or $type eq "foot" or $type eq "about") {
296 # TOC, footer, about etc. are called with undefined $element and $type == "toc"|"stoc"|"foot"|"about"
297 if ($type eq "top") {
298 $element->{'id'} = $element->{'target'} = "Top";
302 print STDERR "WARNING: Node '$node_name' was NOT found in the map\n"
303 unless ($node_name eq '') or ($element->{'tag'} eq 'unnumberedsec')
304 or ($node_name =~ /NOT REALLY USED/);
306 # derive the name of the anchor (i.e. the part after # in the links!),
307 # don't use texi2html's SECx.x default!
308 my $sec_name = main::remove_texi($element->{'texi'});
309 # if we have a node, use its name:
310 if ($element->{'node_ref'}->{'texi'} ne '') {
311 $sec_name = main::remove_texi($element->{'node_ref'}->{'texi'});
313 my $anchor = $sec_name;
314 if ($element->{translationof}) {
315 $anchor = main::remove_texi($$element{translationof});
317 # normalize to the same file name as texinfo
318 $anchor = texinfo_file_name($anchor);
319 # need to override both target (used as anchor in links to this section) and
320 # id (used in the <a name=..> tag for this section)!
321 $element->{'id'} = $element->{'target'} = $anchor;
322 # Numbered sections will get a filename Node_title, unnumbered sections will use
323 # the file name of the previous numbered section:
324 if (($element->{number}) or ($lastfilename eq '') or ($element->{level} == 1)) {
325 my $filename = $anchor;
326 $filename .= ".$docu_ext" if (defined($docu_ext));
328 $$element{doc_nr} = $docnr;
329 $lastfilename = $filename;
332 $$element{doc_nr} = $docnr;
333 return $lastfilename;
341 ## Load the map file for the corrently processed texi file. We do this
342 # using a command init handler, since texi2html does not have any
343 # other hooks that are called after THISDOC is filled but before phase 2
344 # of the texi2html conversion.
345 sub lilypond_init_map ()
347 my ($docu_dir, $docu_name) = split_texi_filename ($Texi2HTML::THISDOC{'input_file_name'});
348 my $map_filename = main::locate_include_file ("${docu_name}.$Texi2HTML::THISDOC{current_lang}.xref-map")
349 || main::locate_include_file ("${docu_name}.xref-map");
350 $node_to_filename_map = load_map_file ($map_filename);
352 push @Texi2HTML::Config::command_handler_init, \&lilypond_init_map;
356 #############################################################################
357 ### CLEANER LINK TITLE FOR EXTERNAL REFS
358 #############################################################################
360 # The default formatting of external refs returns e.g.
361 # "(lilypond-internals)Timing_translator", so we remove all (...) from the
362 # file_and_node argument. Also, we want only a very simple format, so we don't
363 # even call the default handler!
364 sub lilypond_external_ref($$$$$$)
369 my $file_node = shift;
371 my $cross_ref = shift;
373 my $displaytext = '';
375 # 1) if we have a cross ref name, that's the text to be displayed:
376 # 2) For the top node, use the (printable) name of the manual, unless we
377 # have an explicit cross ref name
378 # 3) In all other cases use the section name
379 if ($cross_ref ne '') {
380 $displaytext = $cross_ref;
381 } elsif (($section eq '') or ($section eq 'Top')) {
382 $displaytext = $book;
384 $displaytext = $section;
387 $displaytext = &$anchor('', $href, $displaytext) if ($displaytext ne '');
388 return &$I('%{node_file_href}', { 'node_file_href' => $displaytext });
390 # Default: format as "see <a ..>NODE</a> section 'SECTION' in BOOK". We don't want this!
391 # return t2h_default_external_ref($type, $section, $book, $file_node, $href, $cross_ref);
398 #############################################################################
399 ### HANDLING TRANSLATED SECTIONS: handle @translationof, secname<->filename
400 ### map stored on disk, xrefs in other manuals load that map
401 #############################################################################
404 # Try to make use of @translationof to generate files according to the original
405 # English section title...
406 sub lilypond_unknown($$$$$)
414 # the @translationof macro provides the original English section title,
415 # which should be used for file/anchor naming, while the title will be
416 # translated to each language
417 # It is already used by extract_texi_filenames.py, so this should not be
418 # necessary here at all. Still, I'll leave the code in just in case the
419 # python script messed up ;-)
420 if ($pass == 1 and $macro eq "translationof") {
421 if (ref($state->{'element'}) eq 'HASH') {
422 $state->{'element'}->{'translationof'} = main::normalise_space($line);
424 return ('', true, undef, undef);
426 return t2h_default_unknown($macro, $line, $pass, $stack, $state);
433 my %translated_books = ();
434 # Construct a href to an external source of information.
435 # node is the node with texinfo @-commands
436 # node_id is the node transliterated and transformed as explained in the
438 # node_xhtml_id is the node transformed such that it is unique and can
439 # be used to make an html cross ref as explained in the texinfo manual
440 # file is the file in '(file)node'
441 sub lilypond_external_href($$$)
445 my $node_hxmlt_id = shift;
447 my $original_func = \&t2h_default_external_href;
449 # 1) Keep a hash of book->section_map
450 # 2) if not file in keys hash => try to load the map (assign empty map if
451 # non-existent => will load only once!)
452 # 3) if node in the section=>(file, anchor) map, replace node_id and
453 # node_xhtml_id by the map's values
454 # 4) call the t2h_default_external_href with these values (or the old ones if not found)
456 if (($node_id ne '') and defined($file) and ($node_id ne 'Top')) {
457 my $map_name = $file;
458 $map_name =~ s/-big-page//;
460 # Load the map if we haven't done so already
461 if (!exists($translated_books{$map_name})) {
462 my ($docu_dir, $docu_name) = split_texi_filename ($Texi2HTML::THISDOC{'input_file_name'});
463 my $map_filename = main::locate_include_file ("${map_name}.$Texi2HTML::THISDOC{current_lang}.xref-map")
464 || main::locate_include_file ("${map_name}.xref-map");
465 $translated_books{$map_name} = load_map_file ($map_filename);
468 # look up translation. use these values instead of the old filename/anchor
469 my $section_name_map = $translated_books{$map_name};
470 my $node_text = main::remove_texi($node);
471 if (defined($section_name_map->{$node_text})) {
472 ($node_id, $node_hxmlt_id) = @{$section_name_map->{$node_text}};
474 print STDERR "WARNING: Unable to find node '$node_text' in book $map_name.\n";
479 return &$original_func($node, $node_id, $node_hxmlt_id, $file);
481 return &$original_func($node, $node_id, $node_hxmlt_id);
489 #############################################################################
490 ### CUSTOM TOC FOR EACH PAGE (in a frame on the left)
491 #############################################################################
493 my $page_toc_depth = 2;
494 my @default_toc = [];
496 # recursively generate the TOC entries for the element and its children (which
497 # are only shown up to maxlevel. All ancestors of the current element are also
498 # shown with their immediate children, irrespective of their level.
499 # Unnumbered entries are only printed out if they are at top-level or their
500 # parent element is an ancestor of the currently viewed node.
501 sub generate_ly_toc_entries($$$$)
504 my $element_path = shift;
505 my $maxlevel = shift;
506 my $always_show_unnumbered_children = shift;
507 # Skip undefined sections, plus all sections generated by index splitting
508 return() if (not defined($element) or exists($element->{'index_page'}));
510 my $level = $element->{'toc_level'};
511 my $is_parent_of_current = $element->{'id'} && $element_path->{$element->{'id'}};
512 my $print_children = ( ($level < $maxlevel) or $is_parent_of_current );
513 my $ind = ' ' x $level;
514 my $this_css_class = $is_parent_of_current ? " class=\"toc_current\"" : "";
516 my $entry = "$ind<li$this_css_class>" . &$anchor ($element->{'tocid'}, "$element->{'file'}#$element->{'id'}",$element->{'text'});
518 my $children = $element->{'section_childs'};
519 # Don't add unnumbered entries, unless they are at top-level or a parent of the current!
520 if (not ($element->{'number'} or $always_show_unnumbered_children)) {
523 if ( $print_children and defined($children) and (ref($children) eq "ARRAY") ) {
524 push (@result, $entry);
525 my @child_result = ();
526 foreach (@$children) {
527 push (@child_result, generate_ly_toc_entries($_, $element_path, $maxlevel, $is_parent_of_current));
529 # if no child nodes were generated, e.g. for the index, where expanded pages
530 # are ignored, don't generate a list at all...
532 push (@result, "\n$ind<ul$NO_BULLET_LIST_ATTRIBUTE>\n");
533 push (@result, @child_result);
534 push (@result, "$ind</ul></li>\n");
537 push (@result, $entry . "</li>\n");
543 # Print a customized TOC, containing only the first two levels plus the whole
544 # path to the current page
545 sub lilypond_generate_page_toc_body($)
548 my $current_element = $element;
550 $parentelements{$element->{'id'}} = 1;
551 # Find the path to the current element
552 while ( defined($current_element->{'sectionup'}) and
553 ($current_element->{'sectionup'} ne $current_element) )
555 $parentelements{$current_element->{'sectionup'}->{'id'}} = 1
556 if ($current_element->{'sectionup'}->{'id'} ne '');
557 $current_element = $current_element->{'sectionup'};
559 return () if not defined($current_element);
560 # Create the toc entries recursively
561 my @toc_entries = ("<div class=\"contents\">\n", "<ul$NO_BULLET_LIST_ATTRIBUTE>\n");
562 my $children = $current_element->{'section_childs'};
563 foreach ( @$children ) {
564 push (@toc_entries, generate_ly_toc_entries($_, \%parentelements, $page_toc_depth, False));
566 push (@toc_entries, "</ul>\n");
567 push (@toc_entries, "</div>\n");
571 sub lilypond_print_toc_div ($$)
575 my @lines = @$tocref;
576 # use default TOC if no custom lines have been generated
577 @lines = @default_toc if (not @lines);
579 print $fh "\n\n<div id=\"tocframe\">\n";
580 print $fh '<h4> ' . $Texi2HTML::NAME{'Contents'} . "</h4>\n";
581 foreach my $line (@lines) {
584 print $fh "</div>\n\n";
588 # Create the custom TOC for this page (partially folded, current page is
589 # highlighted) and store it in a global variable. The TOC is written out after
590 # the html contents (but positioned correctly using CSS), so that browsers with
591 # css turned off still show the contents first.
592 our @this_page_toc = ();
593 sub lilypond_print_element_header
596 my $first_in_page = shift;
597 my $previous_is_top = shift;
598 if ($first_in_page and not @this_page_toc) {
599 if (defined($Texi2HTML::THIS_ELEMENT)) {
600 # Create the TOC for this page
601 @this_page_toc = lilypond_generate_page_toc_body($Texi2HTML::THIS_ELEMENT);
604 return T2H_DEFAULT_print_element_header( $fh, $first_in_page, $previous_is_top);
607 # Generate the HTML output for the TOC
608 sub lilypond_toc_body($)
610 my $elements_list = shift;
611 # Generate a default TOC for pages without THIS_ELEMENT
612 @default_toc = lilypond_generate_page_toc_body(@$elements_list[0]);
613 return T2H_GPL_toc_body($elements_list);
616 # Print out the TOC in a <div> at the beginning of the page
617 sub lilypond_print_page_head($)
620 T2H_DEFAULT_print_page_head($fh);
621 print $fh "<div id=\"main\">\n";
624 # Print out the TOC in a <div> at the end of th page, which will be formatted as a
625 # sidebar mimicking a TOC frame
626 sub print_lilypond_page_foot($)
629 my $program_string = &$program_string();
630 print $fh "<p><font size='-1'>$program_string</font><br>$PRE_BODY_CLOSE</p>\n";
631 print $fh "<!-- FOOTER -->\n\n";
632 print $fh "<!-- end div#main here -->\n</div>\n\n";
634 # Print the TOC frame and reset the TOC:
635 lilypond_print_toc_div ($fh, \@this_page_toc);
639 print $fh "</body>\n</html>\n";
646 #############################################################################
647 ### NICER / MORE FLEXIBLE NAVIGATION PANELS
648 #############################################################################
650 sub get_navigation_text
653 my $text = $NAVIGATION_TEXT{$button};
654 if ( ($button eq 'Back') or ($button eq 'FastBack') ) {
655 $text = $text . $Texi2HTML::NODE{$button} . " ";
656 } elsif ( ($button eq 'Forward') or ($button eq 'FastForward') ) {
657 $text = " " . $Texi2HTML::NODE{$button} . $text;
658 } elsif ( $button eq 'Up' ) {
659 $text = " ".$text.": " . $Texi2HTML::NODE{$button} . " ";
665 # Don't automatically create left-aligned table cells for every link, but
666 # instead create a <td> only on an appropriate '(left|right|center)-aligned-cell-n'
667 # button text. It's alignment as well as the colspan will be taken from the
668 # name of the button. Also, add 'newline' button text to create a new table
669 # row. The texts of the buttons are generated by get_navigation_text and
670 # will contain the name of the next/previous section/chapter.
671 sub lilypond_print_navigation
675 my $vertical = shift;
677 # print $fh '<table cellpadding="', $spacing, '" cellspacing="', $spacing,
678 # "\" border=\"0\" class=\"nav_table\">\n";
679 print $fh "<table class=\"nav_table\">\n";
681 print $fh "<tr>" unless $vertical;
683 foreach my $button (@$buttons)
685 print $fh qq{<tr valign="top" align="left">\n} if $vertical;
686 # Allow (left|right|center)-aligned-cell and newline as buttons!
687 if ( $button =~ /^(.*)-aligned-cell-(.*)$/ )
689 print $fh qq{</td>} unless $beginofline;
690 print $fh qq{<td valign="middle" align="$1" colspan="$2">};
693 elsif ( $button eq 'newline' )
695 print $fh qq{</td>} unless $beginofline;
701 elsif (ref($button) eq 'CODE')
703 &$button($fh, $vertical);
705 elsif (ref($button) eq 'SCALAR')
707 print $fh "$$button" if defined($$button);
709 elsif (ref($button) eq 'ARRAY')
711 my $text = $button->[1];
712 my $button_href = $button->[0];
713 # verify that $button_href is simple text and text is a reference
714 if (defined($button_href) and !ref($button_href)
715 and defined($text) and (ref($text) eq 'SCALAR') and defined($$text))
717 if ($Texi2HTML::HREF{$button_href})
719 my $anchor_attributes = '';
720 if ($USE_ACCESSKEY and (defined($BUTTONS_ACCESSKEY{$button_href})) and ($BUTTONS_ACCESSKEY{$button_href} ne ''))
722 $anchor_attributes = "accesskey=\"$BUTTONS_ACCESSKEY{$button_href}\"";
724 if ($USE_REL_REV and (defined($BUTTONS_REL{$button_href})) and ($BUTTONS_REL{$button_href} ne ''))
726 $anchor_attributes .= " rel=\"$BUTTONS_REL{$button_href}\"";
730 $Texi2HTML::HREF{$button_href},
731 get_navigation_text($$text),
737 print $fh get_navigation_text($$text);
741 elsif ($button eq ' ')
742 { # handle space button
744 ($ICONS && $ACTIVE_ICONS{' '}) ?
745 &$button_icon_img($BUTTONS_NAME{$button}, $ACTIVE_ICONS{' '}) :
746 $NAVIGATION_TEXT{' '};
749 elsif ($Texi2HTML::HREF{$button})
751 my $btitle = $BUTTONS_GOTO{$button} ?
752 'title="' . $BUTTONS_GOTO{$button} . '"' : '';
753 if ($USE_ACCESSKEY and (defined($BUTTONS_ACCESSKEY{$button})) and ($BUTTONS_ACCESSKEY{$button} ne ''))
755 $btitle .= " accesskey=\"$BUTTONS_ACCESSKEY{$button}\"";
757 if ($USE_REL_REV and (defined($BUTTONS_REL{$button})) and ($BUTTONS_REL{$button} ne ''))
759 $btitle .= " rel=\"$BUTTONS_REL{$button}\"";
761 if ($ICONS && $ACTIVE_ICONS{$button})
765 $Texi2HTML::HREF{$button},
766 &$button_icon_img($BUTTONS_NAME{$button},
767 $ACTIVE_ICONS{$button},
768 $Texi2HTML::SIMPLE_TEXT{$button}),
777 $Texi2HTML::HREF{$button},
778 get_navigation_text ($button),
785 { # button is passive
787 $ICONS && $PASSIVE_ICONS{$button} ?
788 &$button_icon_img($BUTTONS_NAME{$button},
789 $PASSIVE_ICONS{$button},
790 $Texi2HTML::SIMPLE_TEXT{$button}) :
792 "[" . get_navigation_text($button) . "]";
794 print $fh "</td>\n" if $vertical;
795 print $fh "</tr>\n" if $vertical;
797 print $fh "</td>" unless $beginofline;
798 print $fh "</tr>" unless $vertical;
799 print $fh "</table>\n";
803 @Texi2HTML::Config::SECTION_BUTTONS =
804 ('left-aligned-cell-1', 'FastBack',
805 'center-aligned-cell-3', 'Top', 'Contents', 'Index', 'About',
806 'right-aligned-cell-1', 'FastForward',
808 'left-aligned-cell-2', 'Back',
809 'center-aligned-cell-1', 'Up',
810 'right-aligned-cell-2', 'Forward'
813 # buttons for misc stuff
814 @Texi2HTML::Config::MISC_BUTTONS = ('center-aligned-cell-3', 'Top', 'Contents', 'Index', 'About');
816 # buttons for chapter file footers
817 # (and headers but only if SECTION_NAVIGATION is false)
818 @Texi2HTML::Config::CHAPTER_BUTTONS =
819 ('left-aligned-cell-1', 'FastBack',
820 'center-aligned-cell-3', 'Top', 'Contents', 'Index', 'About',
821 'right-aligned-cell-1', 'FastForward',
824 # buttons for section file footers
825 @Texi2HTML::Config::SECTION_FOOTER_BUTTONS =
826 ('left-aligned-cell-1', 'FastBack',
827 'center-aligned-cell-3', 'Top', 'Contents', 'Index', 'About',
828 'right-aligned-cell-1', 'FastForward',
830 'left-aligned-cell-2', 'Back',
831 'center-aligned-cell-1', 'Up',
832 'right-aligned-cell-2', 'Forward'
835 @Texi2HTML::Config::NODE_FOOTER_BUTTONS =
836 ('left-aligned-cell-1', 'FastBack',
837 'center-aligned-cell-3', 'Top', 'Contents', 'Index', 'About',
838 'right-aligned-cell-1', 'FastForward',
840 'left-aligned-cell-2', 'Back',
841 'center-aligned-cell-1', 'Up',
842 'right-aligned-cell-2', 'Forward'
849 #############################################################################
851 #############################################################################
853 # For split pages, use index.html as start page!
854 if ($Texi2HTML::Config::SPLIT eq 'section') {
855 $Texi2HTML::Config::TOP_FILE = 'index.html';