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><body><title>LilyPond manuals in TeX</title>\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>";
117 my_system
( "$MAKE -C .. " . join(' ', @todo));
122 print "generating HTML list\n";
123 open HTMLLIST
, ">example_output.html";
124 print HTMLLIST
"<html><body><title>LilyPond examples</title>\n
125 These example files are taken from the LilyPond distribution.\n
126 LilyPond currently only outputs TeX and MIDI. The pictures and\n
127 PostScript files were generated using TeX, Ghostscript and some graphics tools. \n
128 The GIF files have been scaled to eliminate aliasing.";
129 foreach $a (@examples) {
131 print HTMLLIST
"<h1>example file: $name</h1>\n<XMP>\n";
133 open IF
, "$depth/input/$a.ly";
134 input_record_separator IF
"%}";
139 print HTMLLIST
"$desc\n</XMP>";
148 print HTMLLIST
"<ul>";
150 print HTMLLIST
"<li><a href=$inputf> The input file</a>"
153 print HTMLLIST
"<li><a href=$giff>The output (picture)</a>"
156 print HTMLLIST
"<li><a href=$psf>The output (PS)</a>\n"
159 print HTMLLIST
"<li><a href=$midif>The output (MIDI)</a>\n"
161 print HTMLLIST
"</ul>";
163 print HTMLLIST
"</BODY></HTML>";
169 print STDERR
"adding footer\n";
172 foreach $a (<*.html
>) {
175 input_record_separator H
$sep;
188 my $subst = $footstr;
189 $subst .= $back if (! $a =~ /index.html/ );
190 $file =~ s/$sep/$subst$sep/g ;
191 $file =~ s/\.gif/\.$image/g;
204 if (! $f =~ /.txt$/) {
212 print "copying files\n";
213 print `ln -s $depth/out ./docxx` if ( ! -x
"docxx" ) ;
214 my_system
"cp $depth/TODO ./TODO.txt",
215 "cp $depth/ANNOUNCE ./ANNOUNCE.txt",
216 "cp $depth/NEWS ./NEWS.txt",
217 "cp $depth/DEDICATION ./DEDICATION.txt",
225 my_system
"gif2png -d $a";
230 my_system
"cjpeg -o $b $a";
237 my_system
"$MAKE -C $depth doc++";
243 $files = join (' ', < *.html
*.$image *.ps
.gz
*.txt
*.midi docxx
/*>);
245 "-$TAR zvhcf website.tar.gz $files;",
246 # "gzip -f9 website.tar;";
251 print STDERR
"This is " . $id_str . "\n";
257 GetOptions
("jpeg", "gif", "png", "noexamples");
260 $image = "png" if ($opt_png);
261 $image = "jpeg" if ($opt_jpeg);
266 die "need to be in directory Documentation\n" if ( ! ($cwd =~ /Documentation$/));
274 $ENV{"TEXINPUTS"} .= ":$depth/input/:";
275 $ENV{"LILYINCLUDE"} = "$depth/input/";
280 if (! $opt_noexamples) {