2 # stupid script to generate WWW site.
8 my $mw_id = "<!make_website!>";
9 my $id_str = "make-website 0.3";
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 index</a>\n<hr>
45 This page was generated by <code>" . $id_str . "</code> from lilypond-$lily_version by
47 <address><br>$username <a href=mailto:$MAILADRESS><<!bla>$MAILADRESS</a>></address>
53 # do something, check return status
57 foreach $cmd (@cmds) {
61 $cmd = substr ($cmd, 1);
64 my $ret = ( system ($cmd));
67 print STDERR "ignoring failed command \`$cmd\' (status $ret)\n";
69 print STDERR "\nmake_website: failed on command \`$cmd\' (status $ret)\n";
77 local $base="lilypond/";
78 local @examples=("twinkle", "multi", "wohltemperirt" ,"standchen", "toccata-fuga-E",
79 "scsii-menuetto", "collisions", "cadenza", "scales");
86 print "generating HTML\n";
87 my_system "$MAKE -kC .. html";
92 print "generating examples: \n";
94 foreach $a (@examples) {
95 push @todo, "out/$a.ps.gz", "out/$a.gif", "out/$a.ly.txt";
98 my_system ("$MAKE -C .. " . join(' ', @todo));
101 my @texstuff = ("mudela-man", "mudela-course");
105 print "generating TeX doco list\n";
106 open HTMLLIST, ">tex_manuals.html";
107 print HTMLLIST "<HTML><TITLE>LilyPond manuals</title>\n" ;
108 print HTMLLIST "<BODY><h1>LilyPond manuals (in PostScript)</h1>";
109 print HTMLLIST "<ul>\n";
111 foreach $a (@texstuff) {
112 push @todo , "out/$a.ps.gz";
113 print HTMLLIST "<li><a href=$a.ps.gz>$a.ps.gz</a>";
115 print HTMLLIST "</ul>";
117 print HTMLLIST "</BODY></HTML>";
120 my_system( "$MAKE -C .. " . join(' ', @todo));
125 print "generating HTML list\n";
126 open HTMLLIST, ">example_output.html";
127 print HTMLLIST "<html><body><title>LilyPond examples</title>\n
128 These example files are taken from the LilyPond distribution.\n
129 LilyPond currently only outputs TeX and MIDI. The pictures and\n
130 PostScript files were generated using TeX, Ghostscript and some graphics tools. \n
131 The GIF files have been scaled to eliminate aliasing.";
132 foreach $a (@examples) {
134 print HTMLLIST "<h1>example file: $name</h1>\n<XMP>\n";
136 open IF, "$depth/input/$a.ly";
137 input_record_separator IF "%}";
142 print HTMLLIST "$desc\n</XMP>";
151 print HTMLLIST "<ul>";
153 print HTMLLIST "<li><a href=$inputf> The input file</a>"
156 print HTMLLIST "<li><a href=$giff>The output (picture)</a>"
159 print HTMLLIST "<li><a href=$psf>The output (PS)</a>\n"
162 print HTMLLIST "<li><a href=$midif>The output (MIDI)</a>\n"
164 print HTMLLIST "</ul>";
166 print HTMLLIST "</BODY></HTML>";
172 print STDERR "adding footer\n";
175 foreach $a (<*.html>) {
178 input_record_separator H $sep;
191 my $subst = $footstr;
192 $subst .= $back if (! $a =~ /index.html/ );
193 $file =~ s/$sep/$subst$sep/g ;
194 $file =~ s/\.gif/\.$image/g;
207 if (! $f =~ /.txt$/) {
215 print "copying files\n";
216 print `ln -s $depth/out ./docxx` if ( ! -x "docxx" ) ;
217 my_system "cp $depth/TODO ./TODO.txt",
218 "cp $depth/ANNOUNCE ./ANNOUNCE.txt",
219 "cp $depth/NEWS ./NEWS.txt",
220 "cp $depth/DEDICATION ./DEDICATION.txt",
228 my_system "gif2png -d $a";
233 my_system "cjpeg -o $b $a";
240 my_system "$MAKE -C $depth doc++";
246 $files = join (' ', < *.html *.$image *.ps.gz *.txt *.midi docxx/*>);
248 "-$TAR zvhcf website.tar.gz $files;",
249 # "gzip -f9 website.tar;";
254 print STDERR "This is " . $id_str . "\n";
260 GetOptions("jpeg", "gif", "png", "noexamples");
263 $image = "png" if ($opt_png);
264 $image = "jpeg" if ($opt_jpeg);
269 die "need to be in directory Documentation\n" if ( ! ($cwd =~ /Documentation$/));
277 $ENV{"TEXINPUTS"} .= ":$depth/input/:";
278 $ENV{"LILYINCLUDE"} = "$depth/input/";
283 if (! $opt_noexamples) {