]> git.donarmstrong.com Git - lilypond.git/blob - bin/make_website
5b360b94fbdb5bb5113ec6af568cefde61b1b9cb
[lilypond.git] / bin / make_website
1 #!/usr/bin/perl -w
2 sub
3         set_hrefs
4 {
5     while (<HTMLIN>) {
6         s#href=([A-Za-z.]+)#href=$base/$1#g;
7         print HTMLOUT $_;
8     }
9 }
10
11 sub all_refs
12 {
13     print "resetting refs.\n";
14
15     foreach $a (<*.html>)
16     {
17         rename $a, "$a~";
18         open HTMLIN, "$a~";
19         open HTMLOUT, ">$a";
20         set_hrefs;
21     }
22 }
23
24 local $base="lilypond/";
25 local @examples=("wohltemperirt");
26
27 system  'pod2html';
28
29 print "generating examples";
30
31 foreach $a (@examples) {
32     $texfile="test";
33     system "ln ../input/$a.ly ./$a.ly.txt";
34     system "cd ..; lilypond input/$a; tex $texfile;".
35         "dvips -o $texfile.ps $texfile;";
36
37     # generate the pixmap at twice the size, then rescale (for antialiasing)
38     if ( ! -f "$a.gif" ) {
39     system "mv ../$texfile.ps $a.ps; ".
40         "mv ../lelie.midi $a.midi; ".
41         "gs -q -sDEVICE=ppmraw -sOutputFile=- -r200 -dNOPAUSE  $a.ps -c quit |pnmscale 0.5| ppmtogif > $a.gif";
42     }   
43 }
44
45 system "cd out; tar hcf ../website.tar *.html *.gif lelie_logo.png *.ps *.ly.txt *.midi docxx/;" .
46     "gzip -f9 website.tar;"