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",
75 "scsii-menuetto", "collisions", "cadenza", "scales", "book");
82 print "generating HTML\n";
83 my_system
"make -kC .. html";
91 my_system
("gunzip -c $a.ps.gz > $a.ps");
93 my_system
"gs -q -sDEVICE=ppmraw -sOutputFile=- -r200 -dNOPAUSE $a.ps -c quit |pnmscale 0.5| ppmtogif > $a.gif";
102 my_system
"gs -q -sDEVICE=ppmraw -sOutputFile=- -r200 -dNOPAUSE $in -c quit |pnmscale 0.5| cjpeg -grayscale > $a.jpeg";
107 print "generating examples: \n";
108 foreach $a (@examples) {
110 $tex = "tex $texfile";
111 if ($a eq "standchen" || $a eq "scsii-menuetto" || $a eq "book" ) {
116 if ( ! -f
"$a.ly.txt" ) {
117 my_system
"ln $depth/input/$a.ly ./$a.ly.txt";
119 if (! -f
"$a.dvi" ) {
120 my_system
"lilypond $a;",
121 "$tex", "-mv $texfile.dvi $a.dvi";
123 if ( ! -f
"$a.ps.gz" && ! -f
"$a.ps" ) {
124 my_system
"dvips -o $a.ps $a.dvi";
127 my_system
"mv lelie.midi $a.midi; " if ( -f
"lelie.midi" );
129 # generate the pixmap at twice the size, then rescale (for antialiasing)
130 if ( ! -f
"$a.gif" ) {
133 if ( ! -f
"$a.ps.gz" ) {
134 my_system
"gzip -f $a.ps";
142 print "generating HTML list\n";
143 open HTMLLIST
, ">example_output.html";
144 print HTMLLIST
"<html><body><title>LilyPond examples</title>\n
145 These example files are taken from the LilyPond distribution.\n
146 LilyPond currently only outputs TeX and MIDI. The pictures and\n
147 PostScript files were generated using TeX, Ghostscript and some graphics tools. \n
148 The GIF files have been scaled to eliminate aliasing.";
149 foreach $a (@examples) {
151 print HTMLLIST
"<h1>example file: $name</h1>\n<XMP>\n";
153 open IF
, "$depth/input/$a.ly";
154 input_record_separator IF
"%}";
159 print HTMLLIST
"$desc\n</XMP>";
168 print HTMLLIST
"<ul>";
170 print HTMLLIST
"<li><a href=$inputf> The input file</a>"
173 print HTMLLIST
"<li><a href=$giff>The output (picture)</a>"
176 print HTMLLIST
"<li><a href=$psf>The output (PS)</a>\n"
179 print HTMLLIST
"<li><a href=$midif>The output (MIDI)</a>\n"
181 print HTMLLIST
"</ul>";
183 print HTMLLIST
"</BODY></HTML>";
189 print STDERR
"adding footer\n";
192 foreach $a (<*.html
>) {
195 input_record_separator H
$sep;
208 my $subst = $footstr;
209 $subst .= $back if (! $a =~ /index.html/ );
210 $file =~ s/$sep/$subst$sep/g ;
211 $file =~ s/\.gif/\.$image/g;
221 print "copying files\n";
222 print `ln -s $depth/out ./docxx` if ( ! -x
"docxx" ) ;
223 my_system
"cp $depth/TODO ./TODO.txt",
224 "cp $depth/NEWS ./NEWS.txt",
232 my_system
"gif2png -d $a";
237 my_system
"cjpeg -o $b $a";
244 my_system
"make -C $depth doc++";
250 $files = join (' ', < *.html
*.$image *.ps
.gz
*.txt
*.midi docxx
/*>);
252 "-tar vhcf website.tar $files;",
253 "gzip -f9 website.tar;";
257 print STDERR
"make_website 0.1\n";
263 GetOptions
("jpeg", "gif", "png", "noexamples");
266 $image = "png" if ($opt_png);
267 $image = "jpeg" if ($opt_jpeg);
272 die "need to be in directory Documentation\n" if ( ! ($cwd =~ /Documentation$/));
280 $ENV{"TEXINPUTS"} .= ":$depth/input/:";
281 $ENV{"LILYINCLUDE"} = "$depth/input/";
286 if (! $opt_noexamples) {