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/";
77 local @examples=("twinkle", "multi", "wohltemperirt" ,"standchen", "toccata-fuga-E",
78 "scsii-menuetto", "collisions", "cadenza", "scales", "twinkle-pop");
85 print "generating HTML\n";
86 my_system "$MAKE -kC .. html";
91 print "generating examples: \n";
93 foreach $a (@examples) {
94 push @todo, "out/$a.ps.gz", "out/$a.gif", "out/$a.ly.txt";
97 my_system ("$MAKE -C .. " . join(' ', @todo));
100 my @texstuff = ("mudela-man", "mudela-course");
104 print "generating TeX doco list\n";
105 open HTMLLIST, ">tex_manuals.html";
106 print HTMLLIST "<HTML><TITLE>PostScript Manuals</TITLE>\n" ;
107 print HTMLLIST "<BODY><h1>LilyPond manuals (in PostScript)</h1>";
108 print HTMLLIST "<ul>\n";
110 foreach $a (@texstuff) {
111 push @todo , "out/$a.ps.gz";
112 print HTMLLIST "<li><a href=$a.ps.gz>$a.ps.gz</a>";
114 print HTMLLIST "</ul>";
116 print HTMLLIST "</BODY></HTML>";
119 my_system( "$MAKE -C .. " . join(' ', @todo));
124 print "generating HTML list\n";
125 open HTMLLIST, ">example_output.html";
126 print HTMLLIST "<html><body><TITLE>Rendered Examples</TITLE>\n
127 These example files are taken from the LilyPond distribution.\n
128 LilyPond currently only outputs TeX and MIDI. The pictures and\n
129 PostScript files were generated using TeX, Ghostscript and some graphics tools. \n
130 The GIF files have been scaled to eliminate aliasing.";
131 foreach $a (@examples) {
133 print HTMLLIST "<h1>example file: $name</h1>\n<XMP>\n";
135 open IF, "$depth/input/$a.ly";
136 input_record_separator IF "%}";
141 print HTMLLIST "$desc\n</XMP>";
150 print HTMLLIST "<ul>";
152 print HTMLLIST "<li><a href=$inputf> The input file</a>"
155 print HTMLLIST "<li><a href=$giff>The output (picture)</a>"
158 print HTMLLIST "<li><a href=$psf>The output (PS)</a>\n"
161 print HTMLLIST "<li><a href=$midif>The output (MIDI)</a>\n"
163 print HTMLLIST "</ul>";
165 print HTMLLIST "</BODY></HTML>";
171 print STDERR "adding footer\n";
174 foreach $a (<*.html>) {
177 input_record_separator H $sep;
190 my $subst = $footstr;
191 $subst .= $back if (! $a =~ /index.html/ );
192 $file =~ s/$sep/$subst$sep/g ;
193 $file =~ s/\.gif/\.$image/g;
194 $file =~ s!<TITLE>(.*)</TITLE>!<TITLE>LilyPond WWW: $1</TITLE>!g;
208 if (! $f =~ /.txt$/) {
216 print "copying files\n";
217 my_system "ln -s $depth/out ./docxx" if ( ! -x "docxx" ) ;
218 my_system "cp $depth/TODO ./TODO.txt",
219 "cp $depth/ANNOUNCE ./ANNOUNCE.txt",
220 "cp $depth/NEWS ./NEWS.txt",
221 "cp $depth/DEDICATION ./DEDICATION.txt",
229 my_system "gif2png -d $a";
234 my_system "cjpeg -o $b $a";
241 open BANNER, ">/tmp/lilybanner.html";
243 $ban =~ s!index.html!../index.html!g;
246 my_system "$MAKE -C $depth docxx-opts=\"-p -S -k -B /tmp/lilybanner.html\" doc++";
247 # should add a cute header.
253 $files = join (' ', < *.html *.$image *.ps.gz *.txt *.midi docxx/*>);
255 "-$TAR zvhcf website.tar.gz $files;",
256 # "gzip -f9 website.tar;";
261 print STDERR "This is " . $id_str . "\n";
267 GetOptions("jpeg", "gif", "png", "noexamples");
270 $image = "png" if ($opt_png);
271 $image = "jpeg" if ($opt_jpeg);
276 die "need to be in directory Documentation\n" if ( ! ($cwd =~ /Documentation$/));
284 $ENV{"TEXINPUTS"} .= ":$depth/input/:";
285 $ENV{"LILYINCLUDE"} = "$depth/input/";
290 if (! $opt_noexamples) {