]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/web-texi2html.init
Doc: CG: add warning about non-sequential reading.
[lilypond.git] / Documentation / web-texi2html.init
index 2bc6275b6d6bfcdd96c9f884c383445bae6f36a4..52b7af2f6cd9635ee9b5b1badae9c628e98ef179 100644 (file)
@@ -1,6 +1,12 @@
 #!/usr/bin/env perl
 # -*- coding: utf-8; -*-
 
+# this file is a complete mess.  Some things are commented out
+# because that's the only way it works.  About 70% of the code in
+# this file is never called.  All in all, it's in drastic need of
+# a complete review/editing, but we don't have the time right now.
+
+
 ### WTF, perl cannot read a file?
 ###use File::Slurp qw( read_file );
 
@@ -104,6 +110,9 @@ sub ly_get_string () {
 ###  SETTINGS FOR TEXI2HTML
 #############################################################################
 
+# no bgcolor and link colors in <body> tag
+# in texi2html >=1.83, override $Texi2HTML::Config::html_default_bodytext instead
+$Texi2HTML::Config::BODYTEXT = "";
 # 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">';
 
@@ -124,9 +133,9 @@ $Texi2HTML::Config::SEPARATED_FOOTNOTES = 0; # Print footnotes on same page, not
 # FIXME: creates duplicate anchors, which causes Opera to barf;
 #       should be fixed in lilypond-texi2html.init too
 # Uhm, what about a bug report to Opera?  We need sane names here.
-if ($Texi2HTML::Config::SPLIT eq 'section') {
-  $Texi2HTML::Config::element_file_name    = \&lilypond_element_file_name;
-}
+#if ($Texi2HTML::Config::SPLIT eq 'section') {
+$Texi2HTML::Config::element_file_name    = \&lilypond_element_file_name;
+#}
 $Texi2HTML::Config::element_target_name  = \&lilypond_element_target_name;
 $default_print_element_header = $Texi2HTML::Config::print_element_header;
 $Texi2HTML::Config::print_element_header = \&lilypond_print_element_header;
@@ -223,6 +232,8 @@ sub texinfo_file_name($)
     $result = 't_g' . $result;
   }
   # DONE
+  # we also want lower-case
+  $result = lc($result);
   return $result
 }
 
@@ -318,15 +329,6 @@ sub lilypond_css_lines ($$)
 ###  SPLITTING BASED ON NUMBERED SECTIONS
 #############################################################################
 
-# FIXME: removed for GOP.
-
-# Uhm, yes: that's what I found.  It was gone.  No need to add that
-# in a comment, DIFF tells me that it's gone.
-
-# Comments can be used to tell *why* something has been removed -- as
-# it seems to me that we *need* this in order to get sane,
-# untranslated, html file names?  Putting it back for this reason.
-
 my $lastfilename;
 my $docnr = 0;
 my $node_to_filename_map = ();
@@ -362,7 +364,10 @@ sub lilypond_element_file_name($$$)
   # will not be able to retrieve the file name for xrefs!!! Still, I already
   # had that code, so I'll leave it in in case something goes wrong with the
   # extract_texi_filenames.py script in the lilypond build process!
-  if (exists ($node_to_filename_map->{$node_name})) {
+
+  # FIXME: disable this section of code, I don't understand why but
+  # it gives us the filenames we want.  -gp
+  if (0 and exists ($node_to_filename_map->{$node_name})) {
     (my $filename, my $anchor) = @{$node_to_filename_map->{$node_name}};
     $filename .= ".$docu_ext" if (defined($docu_ext));
 
@@ -389,7 +394,8 @@ sub lilypond_element_file_name($$$)
 
     # Numbered sections will get a filename Node_title, unnumbered sections will use
     # the file name of the previous numbered section:
-    if (($element->{number}) or ($lastfilename eq '') or ($element->{level} == 1)) {
+    # FIXME: above comment is false; for web we want to give them all new filenames.
+    if (1 or ($element->{number}) or ($lastfilename eq '') or ($element->{level} > 1)) {
       # normalize to the same file name as texinfo
       if ($element->{translationof}) {
         $node_name = main::remove_texi($element->{translationof});
@@ -399,10 +405,10 @@ sub lilypond_element_file_name($$$)
       $docnr += 1;
       $$element{doc_nr} = $docnr;
       $lastfilename = $filename;
-      return $filename;
+      return lc($filename);
     } else {
       $$element{doc_nr} = $docnr;
-      return $lastfilename;
+      return lc($lastfilename);
     }
   }
 
@@ -645,7 +651,7 @@ sub generate_ly_toc_entries($$$)
   my @color_3 = (
         "Productions", "Testimonials",
        "Source", "Old downloads",
-        "FAQ", "Changes", "Internals",
+        "Web", "FAQ", "Changes", "Extend", "Internals",
         "Publications", "Old news"
         );
   my @color_4 = (
@@ -753,8 +759,8 @@ sub lilypond_generate_page_toc_body($)
     if (!exists($main::value{'shallow_toc'})) {
 # WTF, perl needs 6 lines of magic to do: ' ' + open ('file-name').read ()?
        local $/=undef;
-        my $name = 'search-box.html';
-       open FILE, $name or open FILE, "../$name" or die  die "no such file: $name: $!";
+        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: $!";
 
 # All these also seems to work, but fail silently.  Great, it runs!
 # It's late already, let's this broken site.
@@ -880,6 +886,8 @@ sub print_lilypond_page_foot($)
   print $fh "</div>\n";
   }
 
+  # FIXME: This div and p#languages need to be in div#footer.
+  #        Should we move this div to postprocess_html.py ?
   print $fh "<div id=\"verifier_texinfo\">\n";
   print $fh "<h3>Validation</h3>\n";
   print $fh "<p>Thanks to <a href=\"http://www.webdev.nl/\">webdev.nl</a>";
@@ -889,7 +897,6 @@ sub print_lilypond_page_foot($)
   print $fh "     alt=\"Valid HTML 4.01 Transitional\"\n";
   print $fh "     height=\"31\" width=\"88\"></a></p>\n";
   print $fh "</div>";
-  print $fh "</div>";
 
   # Print the TOC frame and reset the TOC:
   lilypond_print_toc_div ($fh, \@this_page_toc);