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($<));
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";
63 s#href=([A-Za-z.]+)#href=$base/$1#g;
70 print "resetting refs.\n";
81 local $base="lilypond/";
82 local @examples=("wohltemperirt" ,"standchen", "scsii-menuetto", "rhythm", "collisions");
87 print "generating HTML\n";
88 my_system "make -kC .. html";
93 print "generating examples: \n";
94 foreach $a (@examples) {
96 $tex = "tex $texfile";
97 if ($a eq "standchen" || $a eq "scsii-menuetto" ) {
102 if ( ! -f "$a.ly.txt" ) {
103 my_system "ln $depth/input/$a.ly ./$a.ly.txt";
105 if ( ! -f "$a.ps.gz" ) {
106 my_system "lilypond $a;",
108 "dvips -o $a.ps $texfile;";
112 my_system "mv lelie.midi $a.midi; " if ( -f "lelie.midi" );
114 # generate the pixmap at twice the size, then rescale (for antialiasing)
115 if ( ! -f "$a.gif" ) {
116 my_system "gs -q -sDEVICE=ppmraw -sOutputFile=- -r200 -dNOPAUSE $a.ps -c quit |pnmscale 0.5| ppmtogif > $a.gif",
125 print "generating HTML list\n";
126 open HTMLLIST, ">example_output.html";
127 print HTMLLIST "<html><body><title>LilyPond examples</title>\n";
128 foreach $a (@examples) {
130 print HTMLLIST "<h1>example file: $name</h1>\n<XMP>\n";
132 open IF, "$depth/input/$a.ly";
133 input_record_separator IF "%}";
138 print HTMLLIST "$desc\n</XMP>";
146 <li><a href=$inputf> The input file</a>
147 <li><a href=$giff>The output (gif)</a>
148 <li><a href=$psf>The output (PS)</a>\n";
150 print HTMLLIST "<li><a href=$midif>The output (MIDI)</a>\n"
152 print HTMLLIST "</ul>";
154 print HTMLLIST "</BODY></HTML>";
160 print STDERR "adding footer\n";
163 foreach $a (<*.html>) {
166 input_record_separator H $sep;
180 $file =~ s/$sep/$footstr$sep/g ;
190 print "copying files\n";
191 print `ln -s $depth/out ./docxx` if ( ! -x "docxx" ) ;
192 my_system "cp $depth/TODO ./TODO.txt",
193 "cp $depth/NEWS ./NEWS.txt",
199 my_system "make -C $depth doc++";
206 " tar vhcf website.tar *.html *.gif *.ps.gz *.txt *.midi docxx/*;",
207 "gzip -f9 website.tar;";
215 die "need to be in directory Documentation\n" if ( ! ($cwd =~ /Documentation$/));
223 $ENV{"TEXINPUTS"} .= ":$depth/input/:";
224 $ENV{"LILYINCLUDE"} = "$depth/input/";