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",
106 print "generating HTML\n";
107 my_system
"$MAKE -kC .. html";
112 print "generating examples: \n";
114 foreach $a (@examples) {
115 push @todo, "out/$a.ps.gz", "out/$a.gif", "out/$a.ly.txt";
118 my_system
("$MAKE -C .. " . join(' ', @todo));
121 my @texstuff = ("mudela-man", "mudela-course");
125 print "generating TeX doco list\n";
126 open HTMLLIST
, ">tex_manuals.html";
127 print HTMLLIST
"<HTML><TITLE>PostScript Manuals</TITLE>\n" ;
128 print HTMLLIST
"<BODY><h1>LilyPond manuals (in PostScript)</h1>";
129 print HTMLLIST
"<ul>\n";
131 foreach $a (@texstuff) {
132 push @todo , "out/$a.ps.gz";
133 print HTMLLIST
"<li><a href=$a.ps.gz>$a.ps.gz</a>";
135 print HTMLLIST
"</ul>";
137 print HTMLLIST
"</BODY></HTML>";
140 my_system
( "$MAKE -C .. " . join(' ', @todo));
145 print "generating HTML list\n";
146 open HTMLLIST
, ">example_output.html";
148 print HTMLLIST
"<html><body><TITLE>Rendered Examples</TITLE>\n
149 These example files are taken from the LilyPond distribution.
150 LilyPond currently only outputs TeX and MIDI. The pictures and
151 PostScript files were generated using TeX, Ghostscript and some
152 graphics tools. The papersize used for these examples is A4. The GIF
153 files have been scaled to eliminate aliasing.";
157 foreach $a (@examples)
159 $name=$a; print HTMLLIST
"<h1>example file: $name</h1>\n<XMP>\n";
161 open IF
, "$depth/input/$a.ly";
162 input_record_separator IF
"\n}";
167 print HTMLLIST
"$desc\n</XMP>";
176 print HTMLLIST
"<ul>";
178 print HTMLLIST
"<li><a href=$inputf> The input file</a>"
181 print HTMLLIST
"<li><a href=$giff>The output (picture)</a>"
184 print HTMLLIST
"<li><a href=$psf>The output (PS)</a>\n"
187 print HTMLLIST
"<li><a href=$midif>The output (MIDI)</a>\n"
189 print HTMLLIST
"</ul>";
191 print HTMLLIST
"</BODY></HTML>";
197 print STDERR
"adding footer\n";
200 foreach $a (<*.html
>) {
203 input_record_separator H
$sep;
216 my $subst = $footstr;
217 $subst .= $back if (! $a =~ /index.html/ );
218 $file =~ s/$sep/$subst$sep/g ;
219 $file =~ s/\.gif/\.$image/g;
220 $file =~ s!<TITLE>(.*)</TITLE>!<TITLE>LilyPond WWW: $1</TITLE>!g;
234 if (! $f =~ /.txt$/) {
242 open NEWS
, "NEWS.txt";
243 input_record_separator NEWS
"****";
253 $ton = top_of_NEWS
();
254 $ton = "\n<XMP>\n$ton\n</XMP>\n";
255 open INDEX
, "index.html";
256 input_record_separator NEWS
undef;
259 $index =~ s/top_of_NEWS/$ton/;
260 open INDEX
, ">index.html";
268 print "copying files\n";
269 my_system
"ln -s $depth/out ./docxx" if ( ! -x
"docxx" ) ;
270 my_system
"cp $depth/TODO ./TODO.txt",
271 "cp $depth/ANNOUNCE ./ANNOUNCE.txt",
272 "cp $depth/NEWS ./NEWS.txt",
273 "cp $depth/DEDICATION ./DEDICATION.txt";
274 my_system
"make -C .. gifs";
282 my_system
"gif2png -d $a";
287 my_system
"cjpeg -o $b $a";
294 open BANNER
, ">/tmp/lilybanner.html";
296 $ban =~ s!index.html!../index.html!g;
299 my_system
("BANNEROPT=\"-B /tmp/lilybanner.html\" $depth/bin/out/make-docxx");
300 unlink "/tmp/lilybanner.html";
306 $files = join (' ', < *.html
*.$image *.ps
.gz
*.txt
*.midi docxx
/*>);
308 "-$TAR zvhcf website.tar.gz $files;",
309 # "gzip -f9 website.tar;";
314 print STDERR
"This is " . $id_str . "\n";
326 GetOptions
("jpeg", "gif", "png", "noexamples");
329 $image = "png" if ($opt_png);
330 $image = "jpeg" if ($opt_jpeg);
335 die "need to be in directory Documentation\n" if ( ! ($cwd =~ /Documentation$/));
337 print "lily v. " . $lily_version . "\n";
344 $ENV{"TEXINPUTS"} .= ":$depth/input/:";
345 $ENV{"LILYINCLUDE"} = "$depth/input/";
346 $ENV{"LILYTOP"} = $depth;
351 if (! $opt_noexamples) {