### FUNCTIONALITY FOR MAIN WEB PAGES
#############################################################################
-my $web_manual = 0;
-sub lilypond_init_web_manual ()
-{
- if (exists($main::value{'web_manual'}))
- {
- print STDERR "Initializing settings for web site\n";
- $web_manual = 1;
- web_settings();
- }
-}
-push @Texi2HTML::Config::command_handler_process, \&lilypond_init_web_manual;
+our $web_manual;
#############################################################################
### SETTINGS FOR TEXI2HTML
# Validation fix for texi2html<=1.82
$Texi2HTML::Config::DOCTYPE = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">';
-sub web_settings() {
- if ($web_manual) {
- @Texi2HTML::Config::CSS_REFS = (
- {FILENAME => "lilypond-web.css", TITLE => "Default style"}
- );
- } else {
- @Texi2HTML::Config::CSS_REFS = (
- {FILENAME => "lilypond-mccarty.css", TITLE => "Patrick McCarty's design"}
+@Texi2HTML::Config::CSS_REFS = (
+ {FILENAME => "lilypond-mccarty.css", TITLE => "Default style"}
);
- }
-}
@Texi2HTML::Config::ALT_CSS_REFS = (
{FILENAME => "lilypond.css", TITLE => "Andrew Hawryluk's design" },
{FILENAME => "lilypond-blue.css", TITLE => "Kurt Kroon's blue design" },
);
+
+sub web_settings() {
+ print STDERR "Initializing settings for web site\n";
+ $Texi2HTML::Config::BODYTEXT = "";
+ @Texi2HTML::Config::CSS_REFS = (
+ {FILENAME => "lilypond-web.css", TITLE => "Patrick McCarty's design"}
+ );
+ @Texi2HTML::Config::ALT_CSS_REFS = (
+ {FILENAME => "lilypond-web-alt1.css", TITLE => "Alternate style 1"},
+ {FILENAME => "lilypond-web-alt2.css", TITLE => "Alternate style 2"},
+ );
+}
+
+# web_settings() if (exists($main::value{'web_manual'}));
+
$Texi2HTML::Config::USE_ACCESSKEY = 1;
$Texi2HTML::Config::USE_LINKS = 1;
$Texi2HTML::Config::USE_REL_REV = 1;
$Texi2HTML::Config::SEPARATED_FOOTNOTES = 0; # Print footnotes on same page, not separated
if ($Texi2HTML::Config::SPLIT eq 'section' or
- $Texi2HTML::Config::SPLIT eq 'subsubsection') {
+ $Texi2HTML::Config::SPLIT eq 'node') {
$Texi2HTML::Config::element_file_name = \&lilypond_element_file_name;
}
# '<:encoding(utf8)', but decoding from UTF-8 line by line works. -jm
if (open(XREFFILE,'<', $mapfile)) {
my $line;
+ # print STDERR "*** PRINTING MAP FILE LINES ***\n";
while ( $line = decode ('UTF-8', <XREFFILE>) ) {
# parse the tab-separated entries and insert them into the map:
chomp($line);
my @entries = split(/\t/, $line);
if (scalar (@entries) == 3) {
$node_map->{$entries[0]} = [$entries[1], $entries[2]];
+ $, = " ";
+ # print STDERR @entries;
+ # print STDERR "\n";
} else {
print STDERR "Invalid entry in the node file $mapfile: $line\n";
}
}
- # print STDERR %{$node_map};
close (XREFFILE);
} else {
print STDERR "WARNING: Unable to load the map file $mapfile\n";
if (exists ($node_to_filename_map->{$node_name})) {
(my $filename, my $anchor) = @{$node_to_filename_map->{$node_name}};
$filename .= ".$docu_ext" if (defined($docu_ext));
+ $filename = lc($filename);
# unnumbered sections (except those at top-level!) always go to the same
# file as the previous numbered section
- if (not ($element->{number}) and not ($lastfilename eq '') and ($element->{level} > 1)) {
+ if (not $docu_name == "web" and not ($element->{number})
+ and not ($lastfilename eq '') and ($element->{level} > 1)) {
$filename = $lastfilename;
}
if (($filename eq $lastfilename)) {
$$element{doc_nr} = $docnr;
$lastfilename = $filename;
}
- # print STDERR "File name: $filename\n";
- return lc($filename);
+ print STDERR "Output file name: $filename\n";
+ return $filename;
} elsif ($type eq "top" or $type eq "toc" or $type eq "doc" or $type eq "stoc" or $type eq "foot" or $type eq "about") {
return;
}
my $filename = texinfo_file_name($node_name);
$filename .= ".$docu_ext" if (defined($docu_ext));
+ $filename = lc($filename);
$docnr += 1;
$$element{doc_nr} = $docnr;
$lastfilename = $filename;
print STDERR "File name: $filename\n";
- return lc($filename);
+ return $filename;
} else {
$$element{doc_nr} = $docnr;
+ $filename = lc ($filename);
print STDERR "File name: $filename\n";
- return lc($filename);
+ return $filename;
}
}
my $map_filename = main::locate_include_file ("${docu_name}.$Texi2HTML::THISDOC{current_lang}.xref-map")
|| main::locate_include_file ("${docu_name}.xref-map");
print STDERR "Map filename is: $map_filename\nDocu name is $docu_name\n";
+ if ($docu_name eq 'web') {
+ $web_manual = 1;
+ web_settings();
+ }
$node_to_filename_map = load_map_file ($map_filename);
}
push @Texi2HTML::Config::command_handler_init, \&lilypond_init_map;
# Initialize the toc_depth to 1 if the command-line option -D=short_toc is given
sub lilypond_init_toc_depth ()
{
- if (exists($main::value{'short_toc'}) and not exists($main::value{'bigpage'})) {
+ if (exists($main::value{'short_toc'}) and not exists($main::value{'bigpage'})
+ and not $web_manual) {
$page_toc_depth = 1;
}
}
push @Texi2HTML::Config::command_handler_process, \&lilypond_init_toc_depth;
+
# recursively generate the TOC entries for the element and its children (which
# are only shown up to maxlevel. All ancestors of the current element are also
# shown with their immediate children, irrespective of their level.
push (@result, "\n$ind<ul$NO_BULLET_LIST_ATTRIBUTE>\n");
if ($web_manual) {
push (@result, "$ind<li$this_css_class>" . &$anchor ($element->{'tocid'}, "$element->{'file'}#$element->{'target'}","(main)"));
- } else {
- push (@result, @child_result);
}
+ push (@result, @child_result);
push (@result, "$ind</ul>\n");
}
}
# Create the toc entries recursively
my @toc_entries = "";
if ($web_manual) {
- push (@toc_entries, "<ul$NO_BULLET_LIST_ATTRIBUTE>\n");
+ @toc_entries = "<ul$NO_BULLET_LIST_ATTRIBUTE>\n";
# FIXME: add link to main page, really hackily.
if ($element->{'sectionup'}) {
# it's not the top element
push (@toc_entries, generate_ly_toc_entries($_, \%parentelements, $page_toc_depth));
}
# search box
- if ($web_manual) {
+ if ($sergsmoeivjriohuemf) {
# WTF, perl needs 6 lines of magic to do: ' ' + open ('file-name').read ()?
local $/=undef;
my $name = "search-box.html";
- open FILE, "$ENV{SRC_DIR}/$name" or open FILE, "$ENV{SRC_DIR}/../$name" or die die "no such file: $name: $!";
+ open FILE, "$ENV{SRC_DIR}/$name" or open FILE, "$ENV{SRC_DIR}/../$name" or die "no such file: $name: $!";
my $string = <FILE>;
$string = "<li>\n" . $string . "</li>\n";
close FILE;
}
push (@toc_entries, "</ul>\n");
- push (@toc_entries, "</div>\n");
+ if ($web_manual) {
+ push (@toc_entries, "\n");
+ } else {
+ push (@toc_entries, "</div>\n");
+ }
return @toc_entries;
}
$reldir = "../" if ($Texi2HTML::Config::SPLIT eq 'section');
my $uplink = $reldir."web/manuals.${lang}html";
- if ($web_manual) {
- } else {
+ if (not $web_manual) {
print $fh "<p class=\"toc_uplink\"><a href=\"$uplink\"
title=\"Documentation Index\"><< " .
&ly_get_string ('Back to Documentation Index') .
#############################################################################
# For split pages, use index.html as start page!
-if ($Texi2HTML::Config::SPLIT eq 'section') {
+if ($Texi2HTML::Config::SPLIT eq 'section' or
+ $Texi2HTML::Config::SPLIT eq 'node') {
$Texi2HTML::Config::TOP_FILE = 'index.html';
}
-if ($web_node) {
-} else {
- push @Texi2HTML::Config::command_handler_process, \&lilypond_init_toc_depth;
-}
return 1;