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));
63 print STDERR "ignoring failed command \`$cmd\' (status $ret)\n";
65 print STDERR "\nmake_website: failed on command \`$cmd\' (status $ret)\n";
73 local $base="lilypond/";
74 local @examples=("multi", "wohltemperirt" ,"standchen", "toccata-fuga-E", "scsii-menuetto", "collisions");
81 print "generating HTML\n";
82 my_system "make -kC .. html";
90 my_system("gunzip -c $a.ps.gz > $a.ps");
92 my_system "gs -q -sDEVICE=ppmraw -sOutputFile=- -r200 -dNOPAUSE $a.ps -c quit |pnmscale 0.5| ppmtogif > $a.gif";
101 my_system "gs -q -sDEVICE=ppmraw -sOutputFile=- -r200 -dNOPAUSE $in -c quit |pnmscale 0.5| cjpeg -grayscale > $a.jpeg";
106 print "generating examples: \n";
107 foreach $a (@examples) {
109 $tex = "tex $texfile";
110 if ($a eq "standchen" || $a eq "scsii-menuetto" ) {
115 if ( ! -f "$a.ly.txt" ) {
116 my_system "ln $depth/input/$a.ly ./$a.ly.txt";
118 if (! -f "$a.dvi" ) {
119 my_system "lilypond $a;",
120 "$tex", "-mv $texfile.dvi $a.dvi";
122 if ( ! -f "$a.ps.gz" && ! -f "$a.ps" ) {
123 my_system "dvips -o $a.ps $a.dvi";
126 my_system "mv lelie.midi $a.midi; " if ( -f "lelie.midi" );
128 # generate the pixmap at twice the size, then rescale (for antialiasing)
129 if ( ! -f "$a.gif" ) {
132 if ( ! -f "$a.ps.gz" ) {
133 my_system "gzip -f $a.ps";
141 print "generating HTML list\n";
142 open HTMLLIST, ">example_output.html";
143 print HTMLLIST "<html><body><title>LilyPond examples</title>\n
144 These example files are taken from the LilyPond distribution.\n
145 LilyPond currently only outputs TeX and MIDI. The pictures and\n
146 PostScript files were generated using TeX, Ghostscript and some graphics tools. \n
147 The GIF files have been scaled to eliminate aliasing.";
148 foreach $a (@examples) {
150 print HTMLLIST "<h1>example file: $name</h1>\n<XMP>\n";
152 open IF, "$depth/input/$a.ly";
153 input_record_separator IF "%}";
158 print HTMLLIST "$desc\n</XMP>";
167 print HTMLLIST "<ul>";
169 print HTMLLIST "<li><a href=$inputf> The input file</a>"
172 print HTMLLIST "<li><a href=$giff>The output (picture)</a>"
175 print HTMLLIST "<li><a href=$psf>The output (PS)</a>\n"
178 print HTMLLIST "<li><a href=$midif>The output (MIDI)</a>\n"
180 print HTMLLIST "</ul>";
182 print HTMLLIST "</BODY></HTML>";
188 print STDERR "adding footer\n";
191 foreach $a (<*.html>) {
194 input_record_separator H $sep;
207 my $subst = $footstr;
208 $subst .= $back if (! $a =~ /index.html/ );
209 $file =~ s/$sep/$subst$sep/g ;
210 $file =~ s/\.gif/\.$image/g;
220 print "copying files\n";
221 print `ln -s $depth/out ./docxx` if ( ! -x "docxx" ) ;
222 my_system "cp $depth/TODO ./TODO.txt",
223 "cp $depth/NEWS ./NEWS.txt",
231 my_system "gif2png -d $a";
236 my_system "cjpeg -o $b $a";
243 my_system "make -C $depth doc++";
249 $files = join (' ', < *.html *.$image *.ps.gz *.txt *.midi docxx/*>);
251 "-tar vhcf website.tar $files;",
252 "gzip -f9 website.tar;";
256 print STDERR "make_website 0.1\n";
262 GetOptions("jpeg", "gif", "png", "noexamples");
265 $image = "png" if ($opt_png);
266 $image = "jpeg" if ($opt_jpeg);
271 die "need to be in directory Documentation\n" if ( ! ($cwd =~ /Documentation$/));
279 $ENV{"TEXINPUTS"} .= ":$depth/input/:";
280 $ENV{"LILYINCLUDE"} = "$depth/input/";
285 if (! $opt_noexamples) {