X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lilypond-texi2html.init;h=df50fe24c724fd45a4b12c3b389f72c6226e8193;hb=def21b306e2b8fa2d5630fab0878e9922e197f0c;hp=caab10ec7efefa75c2b4bb561e49b447ee188e50;hpb=f73a6e433d582d57dd87487f6ad56a47f47bd083;p=lilypond.git diff --git a/lilypond-texi2html.init b/lilypond-texi2html.init index caab10ec7e..df50fe24c7 100644 --- a/lilypond-texi2html.init +++ b/lilypond-texi2html.init @@ -73,20 +73,12 @@ package Texi2HTML::Config; ### SETTINGS FOR TEXI2HTML ############################################################################# -@Texi2HTML::Config::CSS_REFS = ( - {FILENAME => "lilypond.css", TITLE => "Default Style" } -); -@Texi2HTML::Config::ALT_CSS_REFS = ( - {FILENAME => "lilypond-mccarty.css", TITLE => "Patrick McCarty's design"} -); +@Texi2HTML::Config::CSS_REFS = ("lilypond.css"); $Texi2HTML::Config::USE_ACCESSKEY = 1; $Texi2HTML::Config::USE_LINKS = 1; $Texi2HTML::Config::USE_REL_REV = 1; -$Texi2HTML::Config::SPLIT_INDEX = 0; $Texi2HTML::Config::SEPARATED_FOOTNOTES = 0; # Print footnotes on same page, not separated -if ($Texi2HTML::Config::SPLIT eq 'section') { - $Texi2HTML::Config::element_file_name = \&lilypond_element_file_name; -} +$Texi2HTML::Config::element_file_name = \&lilypond_element_file_name; $Texi2HTML::Config::element_target_name = \&lilypond_element_target_name; $Texi2HTML::Config::print_element_header = \&lilypond_print_element_header; $Texi2HTML::Config::print_page_foot = \&print_lilypond_page_foot; @@ -251,11 +243,7 @@ sub lilypond_css_lines ($$) } foreach my $ref (@CSS_REFS) { - $Texi2HTML::THISDOC{'CSS_LINES'} .= "{TITLE}\" href=\"$ref->{FILENAME}\">\n"; - } - foreach my $ref (@ALT_CSS_REFS) - { - $Texi2HTML::THISDOC{'CSS_LINES'} .= "{FILENAME}\" title=\"$ref->{TITLE}\">\n"; + $Texi2HTML::THISDOC{'CSS_LINES'} .= "\n"; } $Texi2HTML::THISDOC{'CSS_LINES'} .= "\n"; } @@ -617,13 +605,8 @@ sub lilypond_print_toc_div ($$) # use default TOC if no custom lines have been generated @lines = @default_toc if (not @lines); if (@lines) { - print $fh "\n\n
\n"; - print $fh '

' . &$anchor('', - $Texi2HTML::HREF{'Top'}, - $Texi2HTML::NAME{'Top'}, - 'title="Start of the manual"' - ) . "

\n"; + print $fh '

' . $Texi2HTML::NAME{'Contents'} . "

\n"; foreach my $line (@lines) { print $fh $line; } @@ -638,6 +621,7 @@ sub lilypond_print_toc_div ($$) our @this_page_toc = (); sub lilypond_print_element_header { + my $fh = shift; my $first_in_page = shift; my $previous_is_top = shift; if ($first_in_page and not @this_page_toc) { @@ -646,7 +630,7 @@ sub lilypond_print_element_header @this_page_toc = lilypond_generate_page_toc_body($Texi2HTML::THIS_ELEMENT); } } - return T2H_DEFAULT_print_element_header( $first_in_page, $previous_is_top); + return T2H_DEFAULT_print_element_header( $fh, $first_in_page, $previous_is_top); } # Generate the HTML output for the TOC @@ -672,7 +656,7 @@ sub print_lilypond_page_foot($) { my $fh = shift; my $program_string = &$program_string(); -# print $fh "

$program_string
$PRE_BODY_CLOSE

\n"; + print $fh "

$program_string
$PRE_BODY_CLOSE

\n"; print $fh "\n\n"; print $fh "\n
\n\n"; @@ -715,45 +699,48 @@ sub get_navigation_text # will contain the name of the next/previous section/chapter. sub lilypond_print_navigation { + my $fh = shift; my $buttons = shift; my $vertical = shift; my $spacing = 1; - my $result = "\n"; +# print $fh '
\n"; + print $fh "
\n"; - $result .= "" unless $vertical; + print $fh "" unless $vertical; my $beginofline = 1; foreach my $button (@$buttons) { - $result .= qq{\n} if $vertical; + print $fh qq{\n} if $vertical; # Allow (left|right|center)-aligned-cell and newline as buttons! if ( $button =~ /^(.*)-aligned-cell-(.*)$/ ) { - $result .= qq{} unless $beginofline; - $result .= qq{} unless $beginofline; + print $fh qq{} unless $beginofline; - $result .= qq{}; - $result .= qq{}; + print $fh qq{} unless $beginofline; + print $fh qq{}; + print $fh qq{}; $beginofline = 1; } elsif (ref($button) eq 'CODE') { - $result .= &$button($vertical); + &$button($fh, $vertical); } elsif (ref($button) eq 'SCALAR') { - $result .= "$$button" if defined($$button); + print $fh "$$button" if defined($$button); } elsif (ref($button) eq 'ARRAY') { my $text = $button->[1]; my $button_href = $button->[0]; # verify that $button_href is simple text and text is a reference - if (defined($button_href) and !ref($button_href) + if (defined($button_href) and !ref($button_href) and defined($text) and (ref($text) eq 'SCALAR') and defined($$text)) { # use given text if ($Texi2HTML::HREF{$button_href}) @@ -767,7 +754,7 @@ sub lilypond_print_navigation { $anchor_attributes .= " rel=\"$BUTTONS_REL{$button_href}\""; } - $result .= "" . + print $fh "" . &$anchor('', $Texi2HTML::HREF{$button_href}, get_navigation_text($$text), @@ -776,13 +763,13 @@ sub lilypond_print_navigation } else { - $result .= get_navigation_text($$text); + print $fh get_navigation_text($$text); } } } elsif ($button eq ' ') { # handle space button - $result .= + print $fh ($ICONS && $ACTIVE_ICONS{' '}) ? &$button_icon_img($BUTTONS_NAME{$button}, $ACTIVE_ICONS{' '}) : $NAVIGATION_TEXT{' '}; @@ -802,7 +789,7 @@ sub lilypond_print_navigation } if ($ICONS && $ACTIVE_ICONS{$button}) { # use icon - $result .= '' . + print $fh '' . &$anchor('', $Texi2HTML::HREF{$button}, &$button_icon_img($BUTTONS_NAME{$button}, @@ -813,11 +800,11 @@ sub lilypond_print_navigation } else { # use text - $result .= + print $fh '[' . &$anchor('', $Texi2HTML::HREF{$button}, - get_navigation_text($button), + get_navigation_text ($button), $btitle ) . ']'; @@ -825,7 +812,7 @@ sub lilypond_print_navigation } else { # button is passive - $result .= + print $fh $ICONS && $PASSIVE_ICONS{$button} ? &$button_icon_img($BUTTONS_NAME{$button}, $PASSIVE_ICONS{$button}, @@ -833,13 +820,12 @@ sub lilypond_print_navigation "[" . get_navigation_text($button) . "]"; } - $result .= "\n" if $vertical; - $result .= "\n" if $vertical; + print $fh "\n" if $vertical; + print $fh "\n" if $vertical; } - $result .= "" unless $beginofline; - $result .= "" unless $vertical; - $result .= "
}; + print $fh qq{}; $beginofline = 0; } elsif ( $button eq 'newline' ) { - $result .= qq{
\n"; - return $result; + print $fh "" unless $beginofline; + print $fh "" unless $vertical; + print $fh "\n"; }