]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.66
authorfred <fred>
Sun, 24 Mar 2002 19:44:56 +0000 (19:44 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:44:56 +0000 (19:44 +0000)
Documentation/index.pod
bin/make_website

index b90e3b463cc5c9d950055f87ca328773b26ea47f..d650acee2c1e2a54bc05bd78b6de6e2c2b2fa8a7 100644 (file)
@@ -102,21 +102,21 @@ errors
 =item *
 <a href=lelieblond.gif
 >
-The lilypond logo (Big)
+The lilypond logo (Big, format: .gif)
 </a
 >
 
 =item *
 <a href=lelie_logo.gif
 >
-The lilypond logo (in gif format, medium size)
+The lilypond logo (medium size, format: .gif)
 </a
 >
 
 =item *
 <a href=example_output.html
 >
-examples: MIDI, PS, GIF and input.
+examples: MIDI, PS, .gif and input.
 </a
 >
 
index ce8c6bb7936407ecbfd0538dd462eaa2b95a30f3..f5d540306ef229dc3819afc22defe3323b89d090 100755 (executable)
@@ -2,9 +2,11 @@
 # stupid script to generate WWW site.
 
 use FileHandle;
+use Getopt::Long;
 my $lily_version;
 my $footstr;
 my $mw_id = "<!make_website!>";
+
 sub get_version
 {
     my ($vstr)=("");
@@ -49,8 +51,14 @@ sub my_system
 {
     my (@cmds) = @_;
     foreach $cmd (@cmds) {
+       my ($ignoreret)=0;
+       if ( $cmd  =~ /^-/ ) {
+           $ignoreret = 1;
+           $cmd = substr ($cmd, 1);
+       }
+       
        my $ret =  ( system ($cmd));
-       if ($ret) {
+       if (!$ignoreret && $ret) {
            print STDERR "\nmake_website: failed on command \`$cmd\' (status $ret)\n";
            exit 2;
        }
@@ -68,6 +76,25 @@ sub gen_html
     my_system "make -kC .. html";
 }
 
+sub ps_to_gif 
+{
+    my ($a)=@_;
+    if (! -f "$a.ps" ) {
+       my_system("gunzip -c $a.ps.gz > $a.ps");
+    }
+    my_system "gs -q -sDEVICE=ppmraw -sOutputFile=- -r200 -dNOPAUSE  $a.ps -c quit |pnmscale 0.5| ppmtogif > $a.gif";
+}
+
+
+sub ps_to_jpeg
+{ 
+    my ($a)=@_;
+    my $in = "$a.ps";
+    
+    my_system "gs -q -sDEVICE=ppmraw -sOutputFile=- -r200 -dNOPAUSE  $in -c quit |pnmscale 0.5| cjpeg -grayscale > $a.jpeg";
+}
+
 sub gen_examples
 {
     print "generating examples: \n";
@@ -82,19 +109,22 @@ sub gen_examples
        if ( ! -f "$a.ly.txt" ) {
            my_system "ln $depth/input/$a.ly ./$a.ly.txt";
        }
-       if ( ! -f "$a.ps.gz" ) {
+       if (! -f "$a.dvi" ) {
            my_system "lilypond $a;",
-           "$tex",
-           "dvips -o $a.ps $texfile;";
-
+           "$tex", "-mv $texfile.dvi $a.dvi";
+       }  
+       if ( ! -f "$a.ps.gz" && ! -f "$a.ps" ) {
+           my_system "dvips -o $a.ps $a.dvi";
        }
 
-       my_system "mv lelie.midi $a.midi; "     if ( -f "lelie.midi" );
+       my_system "mv lelie.midi $a.midi; " if ( -f "lelie.midi" );
 
        # generate the pixmap at twice the size, then rescale (for antialiasing)
        if ( ! -f "$a.gif" ) {
-           my_system "gs -q -sDEVICE=ppmraw -sOutputFile=- -r200 -dNOPAUSE  $a.ps -c quit |pnmscale 0.5| ppmtogif > $a.gif",
-            "gzip $a.ps";
+           ps_to_gif($a);
+       }
+       if ( ! -f "$a.ps.gz" ) {
+           my_system "gzip -f $a.ps";
        }   
     }
 }
@@ -119,20 +149,28 @@ sub gen_list
 
        $inputf="$a.ly.txt";
        $giff="$a.gif";
+       $jpegf="$a.jpeg";
+       $pngf = "$a.png";
        $psf="$a.ps.gz";
        $midif="$a.midi";
        
-       print HTMLLIST "<ul>
-<li><a href=$inputf> The input file</a>
-<li><a href=$giff>The output (gif)</a>
-<li><a href=$psf>The output (PS)</a>\n";
+       print HTMLLIST "<ul>";
+
+       print HTMLLIST "<li><a href=$inputf> The input file</a>"
+           if ( -f $inputf );
        
-       print HTMLLIST "<li><a href=$midif>The output (MIDI)</a>\n"
+       print HTMLLIST "<li><a href=$giff>The output (picture)</a>"     
+           if ( -f $giff );
+
+       print HTMLLIST "<li><a href=$psf>The output (PS)</a>\n"
+           if ( -f $psf );
+               
+       print HTMLLIST "<li><a href=$midif>The output (MIDI)</a>\n" 
            if ( -f $midif );
        print HTMLLIST "</ul>";
     }
     print HTMLLIST "</BODY></HTML>";
-       close HTMLLIST;
+    close HTMLLIST;
 }
 
 sub edit_html
@@ -159,13 +197,14 @@ sub edit_html
        my $subst =  $footstr;
        $subst .= $back if (! $a =~ /index.html/ );
        $file =~ s/$sep/$subst$sep/g ;
-       
+       $file =~ s/\.gif/\.$image/g;
        open H, ">$a";
        print H $mw_id;
        print H $file;
        close H;
     }
 }
+
 sub copy_files
 {  
     print "copying files\n";
@@ -175,6 +214,20 @@ sub copy_files
     "cp ../lelie*gif .";
 }
 
+sub set_images
+{
+    for $a (<*.gif>) {
+       if ($opt_png) {
+           my_system "gif2png -d $a";
+       }
+       if ($opt_jpeg) {
+           my $b=$a;
+           $b =~ s/.gif/.jpeg/;
+           my_system "cjpeg -o $b $a";
+       }
+    }
+}
+
 sub docxx_update
 {
     my_system "make -C $depth doc++";
@@ -184,12 +237,23 @@ sub do_tar
 {
      print "tarring.\n";
      my_system
-        " tar vhcf website.tar *.html *.gif *.ps.gz *.txt *.midi docxx/*;",
+        " tar vhcf website.tar *.html *.$image *.ps.gz *.txt *.midi docxx/*;",
         "gzip -f9 website.tar;";
 }
-
+sub identify
+{
+    print STDERR "make_website 0.1\n";
+    
+}
 sub main
 {
+    identify;
+    GetOptions("jpeg", "gif", "png");
+
+    local $image="gif" ;
+    $image = "png" if ($opt_png);
+    $image = "jpeg" if ($opt_jpeg);
+    
     $depth = "../";
     my $cwd;
     chomp($cwd = `pwd`);
@@ -207,10 +271,13 @@ sub main
 
     gen_html;
     gen_examples;
-    gen_list;
     copy_files;
+    set_images;
+    gen_list;
     edit_html;
+
     docxx_update;
     do_tar;
 }
+
 main;