5 # stupid script to generate WWW site. The WWW site is my
6 # test-suite for LilyPond, I usually don't distribute versions that
7 # fail to make the website
14 my $mw_id = "<!make_website!>";
15 my $id_str = "make-website 0.4";
22 open V, "$depth/VERSION";
32 $lily_version= "$TOPLEVEL_MAJOR_VERSION.$TOPLEVEL_MINOR_VERSION.$TOPLEVEL_PATCH_LEVEL$TOPLEVEL_MY_PATCH_LEVEL";
35 $lily_version= $lily_version;
42 my $MAILADDRESS=$ENV{MAILADDRESS};
43 my @pw=(getpwuid($<));
47 "\n<hr>Please take me <a href=index.html>back to the index</a>\n
48 of LilyPond -- The GNU Project Music typesetter
51 This page was built using <code>" . $id_str . "</code> from lilypond-"
54 <address><br>$username <a href=mailto:"
55 . $MAILADDRESS . "><<!bla>" . $MAILADDRESS ."</a>></address>
60 # do something, check return status
64 foreach $cmd (@cmds) {
68 $cmd = substr ($cmd, 1);
71 my $ret = ( system ($cmd));
74 print STDERR "ignoring failed command \`$cmd\' (status $ret)\n";
76 print STDERR "\nmake_website: failed on command \`$cmd\' (status $ret)\n";
84 local $base="lilypond/";
86 local @examples=("twinkle-pop",
105 print "generating HTML\n";
106 my_system "$MAKE -kC .. html";
111 print "generating examples: \n";
113 foreach $a (@examples) {
114 push @todo, "out/$a.ps.gz", "out/$a.gif", "out/$a.ly.txt";
117 my_system ("$MAKE -C .. " . join(' ', @todo));
120 my @texstuff = ("mudela-man", "mudela-course");
124 print "generating TeX doco list\n";
125 open HTMLLIST, ">tex_manuals.html";
126 print HTMLLIST "<HTML><TITLE>PostScript Manuals</TITLE>\n" ;
127 print HTMLLIST "<BODY><h1>LilyPond manuals (in PostScript)</h1>";
128 print HTMLLIST "<ul>\n";
130 foreach $a (@texstuff) {
131 push @todo , "out/$a.ps.gz";
132 print HTMLLIST "<li><a href=$a.ps.gz>$a.ps.gz</a>";
134 print HTMLLIST "</ul>";
136 print HTMLLIST "</BODY></HTML>";
139 my_system( "$MAKE -C .. " . join(' ', @todo));
144 print "generating HTML list\n";
145 open HTMLLIST, ">example_output.html";
147 print HTMLLIST "<html><body><TITLE>Rendered Examples</TITLE>\n
148 These example files are taken from the LilyPond distribution.
149 LilyPond currently only outputs TeX and MIDI. The pictures and
150 PostScript files were generated using TeX, Ghostscript and some
151 graphics tools. The papersize used for these examples is A4. The GIF
152 files have been scaled to eliminate aliasing.";
156 foreach $a (@examples)
158 $name=$a; print HTMLLIST "<h1>example file: $name</h1>\n<XMP>\n";
160 open IF, "$depth/input/$a.ly";
161 input_record_separator IF "\n}";
166 print HTMLLIST "$desc\n</XMP>";
175 print HTMLLIST "<ul>";
177 print HTMLLIST "<li><a href=$inputf> The input file</a>"
180 print HTMLLIST "<li><a href=$giff>The output (picture)</a>"
183 print HTMLLIST "<li><a href=$psf>The output (PS)</a>\n"
186 print HTMLLIST "<li><a href=$midif>The output (MIDI)</a>\n"
188 print HTMLLIST "</ul>";
190 print HTMLLIST "</BODY></HTML>";
196 print STDERR "adding footer\n";
199 foreach $a (<*.html>) {
202 input_record_separator H $sep;
215 my $subst = $footstr;
216 $subst .= $back if (! $a =~ /index.html/ );
217 $file =~ s/$sep/$subst$sep/g ;
218 $file =~ s/\.gif/\.$image/g;
219 $file =~ s!<TITLE>(.*)</TITLE>!<TITLE>LilyPond WWW: $1</TITLE>!g;
233 if (! $f =~ /.txt$/) {
241 open NEWS, "NEWS.txt";
242 input_record_separator NEWS "****";
252 $ton = top_of_NEWS();
253 $ton = "\n<XMP>\n$ton\n</XMP>\n";
254 open INDEX, "index.html";
255 input_record_separator NEWS undef;
258 $index =~ s/top_of_NEWS/$ton/;
259 open INDEX, ">index.html";
267 print "copying files\n";
268 my_system "ln -s $depth/out ./docxx" if ( ! -x "docxx" ) ;
269 my_system "cp $depth/TODO ./TODO.txt",
270 "cp $depth/ANNOUNCE ./ANNOUNCE.txt",
271 "cp $depth/NEWS ./NEWS.txt",
272 "cp $depth/DEDICATION ./DEDICATION.txt";
273 my_system "make -C .. gifs";
281 my_system "gif2png -d $a";
286 my_system "cjpeg -o $b $a";
293 open BANNER, ">/tmp/lilybanner.html";
295 $ban =~ s!index.html!../index.html!g;
298 my_system "BANNEROPT=\"-B /tmp/lilybanner.html\" $depth/bin/out/make-docxx";
304 $files = join (' ', < *.html *.$image *.ps.gz *.txt *.midi docxx/*>);
306 "-$TAR zvhcf website.tar.gz $files;",
307 # "gzip -f9 website.tar;";
312 print STDERR "This is " . $id_str . "\n";
318 GetOptions("jpeg", "gif", "png", "noexamples");
321 $image = "png" if ($opt_png);
322 $image = "jpeg" if ($opt_jpeg);
327 die "need to be in directory Documentation\n" if ( ! ($cwd =~ /Documentation$/));
329 print "lily v. " . $lily_version . "\n";
336 $ENV{"TEXINPUTS"} .= ":$depth/input/:";
337 $ENV{"LILYINCLUDE"} = "$depth/input/";
343 if (! $opt_noexamples) {