2 # stupid script to generate WWW site.
7 my $mw_id = "<!make_website!>";
11 open V, "$depth/.version";
21 $lily_version= "$TOPLEVEL_MAJOR_VERSION.$TOPLEVEL_MINOR_VERSION.$TOPLEVEL_PATCH_LEVEL$TOPLEVEL_MY_PATCH_LEVEL";
24 $lily_version= "$TOPLEVEL_MAJOR_VERSION.$TOPLEVEL_MINOR_VERSION.$TOPLEVEL_PATCH_LEVEL$TOPLEVEL_MY_PATCH_LEVEL";
32 my $MAILADRESS=$ENV{MAILADRESS};
33 my @pw=(getpwuid($<));
37 "\n<hr>Please take me <a href=index.html>back to the index</a>\n<hr>
39 This page was generated by <code>make_website</code> from lilypond-$lily_version by
41 <address><br>$username <a href=mailto:$MAILADRESS><<!bla>$MAILADRESS</a>></address>
47 # do something, check return status
51 foreach $cmd (@cmds) {
52 my $ret = ( system ($cmd));
54 print STDERR "\nmake_website: failed on command \`$cmd\' (status $ret)\n";
61 local $base="lilypond/";
62 local @examples=("wohltemperirt" ,"standchen", "scsii-menuetto", "rhythm", "collisions");
67 print "generating HTML\n";
68 my_system "make -kC .. html";
73 print "generating examples: \n";
74 foreach $a (@examples) {
76 $tex = "tex $texfile";
77 if ($a eq "standchen" || $a eq "scsii-menuetto" ) {
82 if ( ! -f "$a.ly.txt" ) {
83 my_system "ln $depth/input/$a.ly ./$a.ly.txt";
85 if ( ! -f "$a.ps.gz" ) {
86 my_system "lilypond $a;",
88 "dvips -o $a.ps $texfile;";
92 my_system "mv lelie.midi $a.midi; " if ( -f "lelie.midi" );
94 # generate the pixmap at twice the size, then rescale (for antialiasing)
95 if ( ! -f "$a.gif" ) {
96 my_system "gs -q -sDEVICE=ppmraw -sOutputFile=- -r200 -dNOPAUSE $a.ps -c quit |pnmscale 0.5| ppmtogif > $a.gif",
105 print "generating HTML list\n";
106 open HTMLLIST, ">example_output.html";
107 print HTMLLIST "<html><body><title>LilyPond examples</title>\n";
108 foreach $a (@examples) {
110 print HTMLLIST "<h1>example file: $name</h1>\n<XMP>\n";
112 open IF, "$depth/input/$a.ly";
113 input_record_separator IF "%}";
118 print HTMLLIST "$desc\n</XMP>";
126 <li><a href=$inputf> The input file</a>
127 <li><a href=$giff>The output (gif)</a>
128 <li><a href=$psf>The output (PS)</a>\n";
130 print HTMLLIST "<li><a href=$midif>The output (MIDI)</a>\n"
132 print HTMLLIST "</ul>";
134 print HTMLLIST "</BODY></HTML>";
140 print STDERR "adding footer\n";
143 foreach $a (<*.html>) {
146 input_record_separator H $sep;
159 my $subst = $footstr;
160 $subst .= $back if (! $a =~ /index.html/ );
161 $file =~ s/$sep/$subst$sep/g ;
171 print "copying files\n";
172 print `ln -s $depth/out ./docxx` if ( ! -x "docxx" ) ;
173 my_system "cp $depth/TODO ./TODO.txt",
174 "cp $depth/NEWS ./NEWS.txt",
180 my_system "make -C $depth doc++";
187 " tar vhcf website.tar *.html *.gif *.ps.gz *.txt *.midi docxx/*;",
188 "gzip -f9 website.tar;";
196 die "need to be in directory Documentation\n" if ( ! ($cwd =~ /Documentation$/));
204 $ENV{"TEXINPUTS"} .= ":$depth/input/:";
205 $ENV{"LILYINCLUDE"} = "$depth/input/";