2 # stupid script to generate WWW site.
8 my $mw_id = "<!make_website!>";
13 open V, "$depth/.version";
23 $lily_version= "$TOPLEVEL_MAJOR_VERSION.$TOPLEVEL_MINOR_VERSION.$TOPLEVEL_PATCH_LEVEL$TOPLEVEL_MY_PATCH_LEVEL";
26 $lily_version= "$TOPLEVEL_MAJOR_VERSION.$TOPLEVEL_MINOR_VERSION.$TOPLEVEL_PATCH_LEVEL$TOPLEVEL_MY_PATCH_LEVEL";
34 my $MAILADRESS=$ENV{MAILADRESS};
35 my @pw=(getpwuid($<));
39 "\n<hr>Please take me <a href=index.html>back to the index</a>\n<hr>
41 This page was generated by <code>make_website</code> from lilypond-$lily_version by
43 <address><br>$username <a href=mailto:$MAILADRESS><<!bla>$MAILADRESS</a>></address>
49 # do something, check return status
53 foreach $cmd (@cmds) {
57 $cmd = substr ($cmd, 1);
60 my $ret = ( system ($cmd));
61 if (!$ignoreret && $ret) {
62 print STDERR "\nmake_website: failed on command \`$cmd\' (status $ret)\n";
69 local $base="lilypond/";
70 local @examples=("wohltemperirt" ,"standchen", "scsii-menuetto", "rhythm", "collisions");
75 print "generating HTML\n";
76 my_system "make -kC .. html";
84 my_system("gunzip -c $a.ps.gz > $a.ps");
86 my_system "gs -q -sDEVICE=ppmraw -sOutputFile=- -r200 -dNOPAUSE $a.ps -c quit |pnmscale 0.5| ppmtogif > $a.gif";
95 my_system "gs -q -sDEVICE=ppmraw -sOutputFile=- -r200 -dNOPAUSE $in -c quit |pnmscale 0.5| cjpeg -grayscale > $a.jpeg";
100 print "generating examples: \n";
101 foreach $a (@examples) {
103 $tex = "tex $texfile";
104 if ($a eq "standchen" || $a eq "scsii-menuetto" ) {
109 if ( ! -f "$a.ly.txt" ) {
110 my_system "ln $depth/input/$a.ly ./$a.ly.txt";
112 if (! -f "$a.dvi" ) {
113 my_system "lilypond $a;",
114 "$tex", "-mv $texfile.dvi $a.dvi";
116 if ( ! -f "$a.ps.gz" && ! -f "$a.ps" ) {
117 my_system "dvips -o $a.ps $a.dvi";
120 my_system "mv lelie.midi $a.midi; " if ( -f "lelie.midi" );
122 # generate the pixmap at twice the size, then rescale (for antialiasing)
123 if ( ! -f "$a.gif" ) {
126 if ( ! -f "$a.ps.gz" ) {
127 my_system "gzip -f $a.ps";
135 print "generating HTML list\n";
136 open HTMLLIST, ">example_output.html";
137 print HTMLLIST "<html><body><title>LilyPond examples</title>\n";
138 foreach $a (@examples) {
140 print HTMLLIST "<h1>example file: $name</h1>\n<XMP>\n";
142 open IF, "$depth/input/$a.ly";
143 input_record_separator IF "%}";
148 print HTMLLIST "$desc\n</XMP>";
157 print HTMLLIST "<ul>";
159 print HTMLLIST "<li><a href=$inputf> The input file</a>"
162 print HTMLLIST "<li><a href=$giff>The output (picture)</a>"
165 print HTMLLIST "<li><a href=$psf>The output (PS)</a>\n"
168 print HTMLLIST "<li><a href=$midif>The output (MIDI)</a>\n"
170 print HTMLLIST "</ul>";
172 print HTMLLIST "</BODY></HTML>";
178 print STDERR "adding footer\n";
181 foreach $a (<*.html>) {
184 input_record_separator H $sep;
197 my $subst = $footstr;
198 $subst .= $back if (! $a =~ /index.html/ );
199 $file =~ s/$sep/$subst$sep/g ;
200 $file =~ s/\.gif/\.$image/g;
210 print "copying files\n";
211 print `ln -s $depth/out ./docxx` if ( ! -x "docxx" ) ;
212 my_system "cp $depth/TODO ./TODO.txt",
213 "cp $depth/NEWS ./NEWS.txt",
221 my_system "gif2png -d $a";
226 my_system "cjpeg -o $b $a";
233 my_system "make -C $depth doc++";
240 " tar vhcf website.tar *.html *.$image *.ps.gz *.txt *.midi docxx/*;",
241 "gzip -f9 website.tar;";
245 print STDERR "make_website 0.1\n";
251 GetOptions("jpeg", "gif", "png");
254 $image = "png" if ($opt_png);
255 $image = "jpeg" if ($opt_jpeg);
260 die "need to be in directory Documentation\n" if ( ! ($cwd =~ /Documentation$/));
268 $ENV{"TEXINPUTS"} .= ":$depth/input/:";
269 $ENV{"LILYINCLUDE"} = "$depth/input/";