2 # stupid script to generate WWW site. -*-Perl-*-
8 my $mw_id = "<!make_website!>";
9 my $id_str = "make-website 0.4";
17 open V, "$depth/VERSION";
27 $lily_version= "$TOPLEVEL_MAJOR_VERSION.$TOPLEVEL_MINOR_VERSION.$TOPLEVEL_PATCH_LEVEL$TOPLEVEL_MY_PATCH_LEVEL";
30 $lily_version= "$TOPLEVEL_MAJOR_VERSION.$TOPLEVEL_MINOR_VERSION.$TOPLEVEL_PATCH_LEVEL$TOPLEVEL_MY_PATCH_LEVEL";
38 my $MAILADRESS=$ENV{MAILADRESS};
39 my @pw=(getpwuid($<));
43 "\n<hr>Please take me <a href=index.html>back to the LilyPond index</a>\n<hr>
45 This page was built using <code>" . $id_str . "</code> from lilypond-$lily_version by
47 <address><br>$username <a href=mailto:$MAILADRESS><<!bla>$MAILADRESS</a>></address>
52 # do something, check return status
56 foreach $cmd (@cmds) {
60 $cmd = substr ($cmd, 1);
63 my $ret = ( system ($cmd));
66 print STDERR "ignoring failed command \`$cmd\' (status $ret)\n";
68 print STDERR "\nmake_website: failed on command \`$cmd\' (status $ret)\n";
76 local $base="lilypond/";
78 local @examples=("twinkle-pop", "twinkle", "multi", "wohltemperirt"
79 ,"standchen", "toccata-fuga-E", "scsii-menuetto",
80 "cadenza", "scales", "rhythm", "gallina");
87 print "generating HTML\n";
88 my_system "$MAKE -kC .. html";
93 print "generating examples: \n";
95 foreach $a (@examples) {
96 push @todo, "out/$a.ps.gz", "out/$a.gif", "out/$a.ly.txt";
99 my_system ("$MAKE -C .. " . join(' ', @todo));
102 my @texstuff = ("mudela-man", "mudela-course");
106 print "generating TeX doco list\n";
107 open HTMLLIST, ">tex_manuals.html";
108 print HTMLLIST "<HTML><TITLE>PostScript Manuals</TITLE>\n" ;
109 print HTMLLIST "<BODY><h1>LilyPond manuals (in PostScript)</h1>";
110 print HTMLLIST "<ul>\n";
112 foreach $a (@texstuff) {
113 push @todo , "out/$a.ps.gz";
114 print HTMLLIST "<li><a href=$a.ps.gz>$a.ps.gz</a>";
116 print HTMLLIST "</ul>";
118 print HTMLLIST "</BODY></HTML>";
121 my_system( "$MAKE -C .. " . join(' ', @todo));
126 print "generating HTML list\n";
127 open HTMLLIST, ">example_output.html";
128 print HTMLLIST "<html><body><TITLE>Rendered Examples</TITLE>\n
129 These example files are taken from the LilyPond distribution.\n
130 LilyPond currently only outputs TeX and MIDI. The pictures and\n
131 PostScript files were generated using TeX, Ghostscript and some graphics tools. \n
132 The GIF files have been scaled to eliminate aliasing.";
133 foreach $a (@examples) {
135 print HTMLLIST "<h1>example file: $name</h1>\n<XMP>\n";
137 open IF, "$depth/input/$a.ly";
138 input_record_separator IF "%}";
143 print HTMLLIST "$desc\n</XMP>";
152 print HTMLLIST "<ul>";
154 print HTMLLIST "<li><a href=$inputf> The input file</a>"
157 print HTMLLIST "<li><a href=$giff>The output (picture)</a>"
160 print HTMLLIST "<li><a href=$psf>The output (PS)</a>\n"
163 print HTMLLIST "<li><a href=$midif>The output (MIDI)</a>\n"
165 print HTMLLIST "</ul>";
167 print HTMLLIST "</BODY></HTML>";
173 print STDERR "adding footer\n";
176 foreach $a (<*.html>) {
179 input_record_separator H $sep;
192 my $subst = $footstr;
193 $subst .= $back if (! $a =~ /index.html/ );
194 $file =~ s/$sep/$subst$sep/g ;
195 $file =~ s/\.gif/\.$image/g;
196 $file =~ s!<TITLE>(.*)</TITLE>!<TITLE>LilyPond WWW: $1</TITLE>!g;
210 if (! $f =~ /.txt$/) {
218 print "copying files\n";
219 my_system "ln -s $depth/out ./docxx" if ( ! -x "docxx" ) ;
220 my_system "cp $depth/TODO ./TODO.txt",
221 "cp $depth/ANNOUNCE ./ANNOUNCE.txt",
222 "cp $depth/NEWS ./NEWS.txt",
223 "cp $depth/DEDICATION ./DEDICATION.txt";
224 my_system "make -C .. gifs";
232 my_system "gif2png -d $a";
237 my_system "cjpeg -o $b $a";
244 open BANNER, ">/tmp/lilybanner.html";
246 $ban =~ s!index.html!../index.html!g;
249 my_system "$MAKE -C $depth docxx-opts=\"-p -S -k -B /tmp/lilybanner.html\" doc++";
250 # should add a cute header.
256 $files = join (' ', < *.html *.$image *.ps.gz *.txt *.midi docxx/*>);
258 "-$TAR zvhcf website.tar.gz $files;",
259 # "gzip -f9 website.tar;";
264 print STDERR "This is " . $id_str . "\n";
270 GetOptions("jpeg", "gif", "png", "noexamples");
273 $image = "png" if ($opt_png);
274 $image = "jpeg" if ($opt_jpeg);
279 die "need to be in directory Documentation\n" if ( ! ($cwd =~ /Documentation$/));
287 $ENV{"TEXINPUTS"} .= ":$depth/input/:";
288 $ENV{"LILYINCLUDE"} = "$depth/input/";
293 if (! $opt_noexamples) {