2 # stupid script to generate WWW site.
8 my $mw_id = "<!make_website!>";
9 my $id_str = "make-website 0.2";
14 open V, "$depth/.version";
24 $lily_version= "$TOPLEVEL_MAJOR_VERSION.$TOPLEVEL_MINOR_VERSION.$TOPLEVEL_PATCH_LEVEL$TOPLEVEL_MY_PATCH_LEVEL";
27 $lily_version= "$TOPLEVEL_MAJOR_VERSION.$TOPLEVEL_MINOR_VERSION.$TOPLEVEL_PATCH_LEVEL$TOPLEVEL_MY_PATCH_LEVEL";
35 my $MAILADRESS=$ENV{MAILADRESS};
36 my @pw=(getpwuid($<));
40 "\n<hr>Please take me <a href=index.html>back to the index</a>\n<hr>
42 This page was generated by <code>" . $id_str . "</code> from lilypond-$lily_version by
44 <address><br>$username <a href=mailto:$MAILADRESS><<!bla>$MAILADRESS</a>></address>
50 # do something, check return status
54 foreach $cmd (@cmds) {
58 $cmd = substr ($cmd, 1);
61 my $ret = ( system ($cmd));
64 print STDERR "ignoring failed command \`$cmd\' (status $ret)\n";
66 print STDERR "\nmake_website: failed on command \`$cmd\' (status $ret)\n";
74 local $base="lilypond/";
75 local @examples=("multi", "wohltemperirt" ,"standchen", "toccata-fuga-E",
76 "scsii-menuetto", "collisions", "cadenza", "scales");
83 print "generating HTML\n";
84 my_system "make -kC .. html";
92 my_system("gunzip -c $a.ps.gz > $a.ps");
94 my_system "gs -q -sDEVICE=ppmraw -sOutputFile=- -r200 -dNOPAUSE $a.ps -c quit |pnmscale 0.5| ppmtogif > $a.gif";
103 my_system "gs -q -sDEVICE=ppmraw -sOutputFile=- -r200 -dNOPAUSE $in -c quit |pnmscale 0.5| cjpeg -grayscale > $a.jpeg";
108 print "generating examples: \n";
109 foreach $a (@examples) {
111 $tex = "tex $texfile";
112 if ($a eq "standchen" || $a eq "scsii-menuetto" ) {
117 if ( ! -f "$a.ly.txt" ) {
118 my_system "ln $depth/input/$a.ly ./$a.ly.txt";
120 if (! -f "$a.dvi" ) {
121 my_system "lilypond $a;",
122 "$tex", "-mv $texfile.dvi $a.dvi";
124 if ( ! -f "$a.ps.gz" && ! -f "$a.ps" ) {
125 my_system "dvips -o $a.ps $a.dvi";
128 my_system "mv lelie.midi $a.midi; " if ( -f "lelie.midi" );
130 # generate the pixmap at twice the size, then rescale (for antialiasing)
131 if ( ! -f "$a.gif" ) {
134 if ( ! -f "$a.ps.gz" ) {
135 my_system "gzip -f $a.ps";
140 my @texstuff = ("mudela-man", "mudela-course");
144 print "generating TeX doco list\n";
145 open HTMLLIST, ">tex_manuals.html";
146 print HTMLLIST "<html><body><title>LilyPond manuals in TeX</title>\n" .
148 foreach $a (@texstuff) {
149 my_system( "make -C $depth/Documentation out/$a.dvi");
150 my_system( "dvips $a", "gzip -9f $a.ps");
151 print HTMLLIST "<li><a href=$a.ps.gz>$a.ps.gz</a>";
153 print HTMLLIST "</ul>";
159 print "generating HTML list\n";
160 open HTMLLIST, ">example_output.html";
161 print HTMLLIST "<html><body><title>LilyPond examples</title>\n
162 These example files are taken from the LilyPond distribution.\n
163 LilyPond currently only outputs TeX and MIDI. The pictures and\n
164 PostScript files were generated using TeX, Ghostscript and some graphics tools. \n
165 The GIF files have been scaled to eliminate aliasing.";
166 foreach $a (@examples) {
168 print HTMLLIST "<h1>example file: $name</h1>\n<XMP>\n";
170 open IF, "$depth/input/$a.ly";
171 input_record_separator IF "%}";
176 print HTMLLIST "$desc\n</XMP>";
185 print HTMLLIST "<ul>";
187 print HTMLLIST "<li><a href=$inputf> The input file</a>"
190 print HTMLLIST "<li><a href=$giff>The output (picture)</a>"
193 print HTMLLIST "<li><a href=$psf>The output (PS)</a>\n"
196 print HTMLLIST "<li><a href=$midif>The output (MIDI)</a>\n"
198 print HTMLLIST "</ul>";
200 print HTMLLIST "</BODY></HTML>";
206 print STDERR "adding footer\n";
209 foreach $a (<*.html>) {
212 input_record_separator H $sep;
225 my $subst = $footstr;
226 $subst .= $back if (! $a =~ /index.html/ );
227 $file =~ s/$sep/$subst$sep/g ;
228 $file =~ s/\.gif/\.$image/g;
238 print "copying files\n";
239 print `ln -s $depth/out ./docxx` if ( ! -x "docxx" ) ;
240 my_system "cp $depth/TODO ./TODO.txt",
241 "cp $depth/NEWS ./NEWS.txt",
249 my_system "gif2png -d $a";
254 my_system "cjpeg -o $b $a";
261 my_system "make -C $depth doc++";
267 $files = join (' ', < *.html *.$image *.ps.gz *.txt *.midi docxx/*>);
269 "-tar vhcf website.tar $files;",
270 "gzip -f9 website.tar;";
275 print STDERR "This is " . $id_str . "\n";
281 GetOptions("jpeg", "gif", "png", "noexamples");
284 $image = "png" if ($opt_png);
285 $image = "jpeg" if ($opt_jpeg);
290 die "need to be in directory Documentation\n" if ( ! ($cwd =~ /Documentation$/));
298 $ENV{"TEXINPUTS"} .= ":$depth/input/:";
299 $ENV{"LILYINCLUDE"} = "$depth/input/";
304 if (! $opt_noexamples) {