]> git.donarmstrong.com Git - lilypond.git/commitdiff
texi2html: Some attempts to make it work in IE
authorReinhold Kainhofer <reinhold@kainhofer.com>
Fri, 9 May 2008 18:29:04 +0000 (20:29 +0200)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Fri, 9 May 2008 18:29:04 +0000 (20:29 +0200)
-) New style sheet, used only by IE to work around non-support of IE for position:fixed; in CSS
-) Add <div id="main"> around the main contents to allow for "proper" (i.e. not-as-much-broken-as-before) positioning in IE
-) Don't generate the default CSS lines in the file.

Documentation/lilypond-ie-fixes.css [new file with mode: 0644]
Documentation/lilypond.css
lilypond-texi2html.init
make/doclang-rules.make
stepmake/stepmake/texinfo-rules.make

diff --git a/Documentation/lilypond-ie-fixes.css b/Documentation/lilypond-ie-fixes.css
new file mode 100644 (file)
index 0000000..0a27395
--- /dev/null
@@ -0,0 +1,13 @@
+/***********************************************************/
+/*                    TOC SIDEBAR                          */
+/***********************************************************/
+body {
+  height: 100%;
+  overflow: hidden;
+  font-size: 100%;
+}
+div#main {
+  width: 100%;
+  height: 100%;
+  overflow: auto;
+}
index 93df57770dedffa4578260c787d4a9b80334d083..d64640180351cfb7a9a7b2b2d7e72e6526fc2181 100644 (file)
@@ -85,8 +85,11 @@ table.cartouche td {
 body {
   padding-left: 27%; /* To create space for the sidebar! */
 }
+div#main {
+}
 div#tocframe {
-  position:      fixed;
+/*   position:      fixed; */
+  position:      absolute;
   top:           0;
   left:          0;
   margin:        0em;
@@ -97,7 +100,18 @@ div#tocframe {
   background-color: #FFFACD;
   z-index:100;
   list-style-type: none;
-}
+  
+/*   float: left; */
+/*   clear: both; */
+}
+
+@media screen
+  {
+  body>div#tocframe
+    {
+    position: fixed;
+    }
+  }
 
 #tocframe .contents {
   width: 100%;
index 953839cec85e1044674acd7f5746131e8eec27b5..64d42e8880c97d8c7a5291363c01d5980f04088f 100644 (file)
@@ -226,7 +226,25 @@ sub lilypond_toc_body($)
 }
 
 
-
+sub lilypond_css_lines ($$)
+{
+    my $import_lines = shift;
+    my $rule_lines = shift;
+    return if (defined($CSS_LINES));
+#     return if (!@$rule_lines and !@$import_lines and (! keys(%css_map)));
+    if (@$rule_lines or @$import_lines)
+    {
+        $CSS_LINES = "<style type=\"text/css\">\n<!--\n";
+        $CSS_LINES .= join('',@$import_lines) . "\n" if (@$import_lines);
+        $CSS_LINES .= join('',@$rule_lines) . "\n" if (@$rule_lines);
+        $CSS_LINES .= "-->\n</style>\n";
+    }
+    foreach my $ref (@CSS_REFS)
+    {
+        $CSS_LINES .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"$ref\">\n";
+    }
+    $CSS_LINES .= "<!--[if lte IE 7]>\n<link href=\"lilypond-ie-fixes.css\" rel=\"stylesheet\" type=\"text/css\">\n<![endif]-->\n";
+}
 
 
 
@@ -239,11 +257,15 @@ sub lilypond_toc_body($)
 sub print_lilypond_page_foot($)
 {
   my $fh = shift;
+  my $program_string = &$program_string();
+  print $fh "<p><font size="-1">$program_string</font><br>$PRE_BODY_CLOSE</p>\n";
+  
+  # Print the TOC frame:
   my @lines = @this_page_toc;
   # use default TOC if no custom lines have been generated
   @lines = @default_toc if (not @lines);
   if (@lines) {
-    print $fh "<div id=\"tocframe\">";
+    print $fh "\n\n<div id=\"tocframe\">";
     print $fh '<h4> ' . $Texi2HTML::NAME{'Contents'}  . "</h4>\n";
     foreach my $line (@lines) {
       print $fh $line;
@@ -251,7 +273,9 @@ sub print_lilypond_page_foot($)
     print $fh "</div>";
     @this_page_toc = ();
   }
-  T2H_DEFAULT_print_page_foot($fh);
+  
+  # Close the page:
+  print $fh "</body>\n</html>\n";
 }
 
 
@@ -465,6 +489,7 @@ $Texi2HTML::Config::print_page_foot      = \&print_lilypond_page_foot;
 $Texi2HTML::Config::print_navigation     = \&lilypond_print_navigation;
 $Texi2HTML::Config::external_ref         = \&lilypond_external_ref;
 $Texi2HTML::Config::toc_body             = \&lilypond_toc_body;
+$Texi2HTML::Config::css_lines            = \&lilypond_css_lines;
 
 
 # For split pages, use index(.lang).html as start page!
@@ -508,6 +533,6 @@ sub lilypond_unknown($$$$$)
 }
 $Texi2HTML::Config::unknown                  = \&lilypond_unknown;
 
-
+%css_map=();
 
 return 1;
index 33101c46b9c68321f58f52b4ad5ab3e39a2be4f7..0b8f359f9c86d541776aa849f57eca49797db2e4 100644 (file)
@@ -2,11 +2,11 @@
 $(outdir)/%/index.html: $(outdir)/%.texi $(OUT_PNG_IMAGES) $(outdir)/version.itexi
        mkdir -p $(dir $@)
        $(TEXI2HTML) --I=$(outdir) $(TEXI2HTML_FLAGS) --output=$(dir $@) --prefix=index --split=section $(TEXI2HTML_INIT) $<
-       cp $(top-src-dir)/Documentation/lilypond.css $(dir $@)
+       cp $(top-src-dir)/Documentation/lilypond*.css $(dir $@)
 
 $(outdir)/%-big-page.html: $(outdir)/%.texi $(OUT_PNG_IMAGES) $(outdir)/version.itexi
        $(TEXI2HTML) --I=$(outdir) $(TEXI2HTML_FLAGS) --output=$@ $(TEXI2HTML_INIT) $<
-       cp $(top-src-dir)/Documentation/lilypond.css $(dir $@)
+       cp $(top-src-dir)/Documentation/lilypond*.css $(dir $@)
 
 $(outdir)/%.pdftexi: $(outdir)/%.texi doc-po $(outdir)/version.itexi
        $(PYTHON) $(buildscript-dir)/texi-gettext.py $(ISOLANG) $<
index 649956f6fb5cb5496d231dfccafe58e546559bf2..c4f72306b7a34c23451347b64bd895df0ac6d52a 100644 (file)
@@ -28,12 +28,12 @@ $(outdir)/%.info: $(outdir)/%.texi $(outdir)/$(INFO_IMAGES_DIR).info-images-dir.
 
 $(outdir)/%-big-page.html: $(outdir)/%.texi $(outdir)/version.itexi
        $(TEXI2HTML) --I=$(outdir) -D bigpage --output=$@ $(TEXI2HTML_INIT) $< 
-       cp $(top-src-dir)/Documentation/lilypond.css $(dir $@)
+       cp $(top-src-dir)/Documentation/lilypond*.css $(dir $@)
 
 
 $(outdir)/%.html: $(outdir)/%.texi $(outdir)/version.itexi
        $(TEXI2HTML) --I=$(outdir) --output=$@ $(TEXI2HTML_INIT) $<
-       cp $(top-src-dir)/Documentation/lilypond.css $(dir $@)
+       cp $(top-src-dir)/Documentation/lilypond*.css $(dir $@)
 
 $(outdir)/%.html.omf: %.texi
        $(call GENERATE_OMF,html)
@@ -47,7 +47,7 @@ $(outdir)/%.ps.gz.omf: %.texi
 $(outdir)/%/index.html: $(outdir)/%.texi $(outdir)/version.itexi
        mkdir -p $(dir $@)
        $(TEXI2HTML) --I=$(outdir) --output=$(dir $@) --prefix=index --split=section $(TEXI2HTML_INIT) $<
-       cp $(top-src-dir)/Documentation/lilypond.css $(dir $@)
+       cp $(top-src-dir)/Documentation/lilypond*.css $(dir $@)
 
 $(outdir)/%.pdf: $(outdir)/%.texi $(outdir)/version.itexi
        cd $(outdir); texi2pdf $(TEXI2PDF_FLAGS) --batch $(TEXINFO_PAPERSIZE_OPTION) $(<F)