Annotation of doc/build/generate_web_pages.pl, revision 1.18

1.1       bowersj2    1: #!/usr/bin/perl -w
                      2: 
                      3: =pod
                      4: 
                      5: =NAME
                      6: 
                      7: generate_web_pages.pl - generate the web pages for the install site
                      8: 
                      9: =SYNOPSIS
                     10: 
                     11: Yeah, it does that.
                     12: 
                     13: Basically, there's a few comments in shell.html that we replace with
                     14:     what we really want in the files. Pretty simple.
                     15: 
                     16: The point of this is to look like the main site.
                     17: 
                     18: =cut
                     19: 
                     20: # This is the list of pages to generate: Change this to
                     21: # add/subtract/etc. pages. Index is done seperately.
                     22: # Title, source
                     23: 
                     24: my @pages = ( 
1.14      matthew    25: #	      ['Red Hat 7.3 Install', 'rh73'],
1.6       matthew    26: 	      ['Fedora Install', 'fedora_install'],
1.13      matthew    27:               ['Fedora Core 3 Install', 'FC3_install'],
1.15      albertel   28:               ['Fedora Core 4 Install', 'FC4_install'],
1.17      raeburn    29:               ['Red Hat Enterprise Linux 4 Install','RHEL4_install'],
1.18    ! raeburn    30:               ['SuSE Linux Professional 9.2 Install, suse9.2_install'],
1.1       bowersj2   31: 	      ['Manual Install from Tarballs', 'manual_install'],
                     32: 	      ['Upgrading from Previous LON-CAPA install', 'upgrade'],
                     33: 	      ['Post-installation Configuration', 'config'],
                     34: 	      ['LON-CAPA License (Gnu Public License)', 'license']
                     35: 	      );
                     36: 
                     37: open SHELL, '<', "shell.html";
                     38: my $shell = join '', <SHELL>;
                     39: $shell =~ s/\r/\n/g;
                     40: 
                     41: # Call with: The title, breadcrumb, and content
                     42: sub replaceText {
                     43:     my ($title, $breadcrumb, $content) = @_;
                     44: 
                     45:     my $page = $shell;
                     46:     $page =~ s/\<!-- *title *--\>/$title/g;
                     47:     $page =~ s/\<!-- *breadcrumb *--\>/$breadcrumb/g;
                     48:     $page =~ s/\<!-- *content *--\>/$content/g;
                     49: 
                     50:     return $page;
                     51: }
                     52: 
                     53: # Do the index page
                     54: 
                     55: open INDEX, '>', "index.html";
                     56: my $content = <<PRELUDE;
                     57: <p>LON-CAPA is based upon a lot of Open Source modules, so it's important
                     58: to have the right environment on your computer. Since it will frequently 
                     59: be the case that LON-CAPA will be going onto a dedicated machine, we've 
                     60: included instructions for installing LON-CAPA concurrently with new
                     61: installations of some of the popular Linux distributions.</p>
                     62: 
                     63: <p>A tarball installation is also available for those who wish to 
                     64: install on other distributions. Currently, Apache 1.x is required;
                     65: LON-CAPA does not yet run on 2.0.</p>
                     66: 
                     67: <p>For all distributions, please see how to 
                     68: <a href="config.html">configure the server after installation</a>.</p>
1.3       bowersj2   69: <hr />
1.1       bowersj2   70: PRELUDE
                     71: 
                     72: $content .= "<ul>\n";
                     73: for (@pages) {
                     74:     $content .= "<li><a href='$_->[1].html'>$_->[0]</a></li>\n";
                     75: }
                     76: 
                     77: $content .= "</ul>\n";
                     78: 
1.4       bowersj2   79: $content .= <<'POSTLUDE';
1.3       bowersj2   80: <hr />
                     81: <a name="download" />
                     82: <h3>Downloading LON-CAPA</h3>
                     83: 
                     84: <p>
1.10      albertel   85: <b>Current Production Release is Version LATESTVERSION.
1.3       bowersj2   86: This version was released on LATESTDATE.</b>
                     87: </p>
                     88: <p>
1.10      albertel   89: You can download the <b>most current production version of LON-CAPA</b> at
1.3       bowersj2   90: <a href="http://install.lon-capa.org/versions/loncapa-current.tar.gz">
                     91: http://install.lon-capa.org/versions/loncapa-current.tar.gz</a>
                     92: (version LATESTVERSION).
                     93: </p>
1.8       albertel   94: TESTINGRELEASE_START
                     95: <p>
1.10      albertel   96: <b>Current Testing Release is Version LATESTTESTINGVERSION.
1.9       albertel   97: This version was released on LATESTTESTINGDATE.</b>
                     98: </p>
                     99: <p>
1.8       albertel  100: You can download the <b>testing version of the upcoming LON-CAPA</b> at
                    101: <a href="http://install.lon-capa.org/versions/loncapa-testing.tar.gz">
                    102: http://install.lon-capa.org/versions/loncapa-testing.tar.gz</a>
1.9       albertel  103: (version LATESTTESTINGVERSION).
1.8       albertel  104: </p>
                    105: TESTINGRELEASE_END
1.3       bowersj2  106: <p>
                    107: The <b>development release of LON-CAPA</b> is at:
                    108: <a href="http://install.lon-capa.org/versions/loncapa-unstable.tar.gz">
                    109: http://install.lon-capa.org/versions/loncapa-unstable.tar.gz</a>.
                    110: </p>
                    111: <p>
1.7       albertel  112: To view the code development history of LON-CAPA, you can access a <a
                    113: href="http://zaphod.lite.msu.edu/cgi-bin/cvsweb.cgi/">web version</a>
                    114: of our CVS respository. Otherwise, please contact Helen (<a
                    115: href="mailto:helen@lon-capa.org"> helen@lon-capa.org</a>) to request a
                    116: CVS USERNAME.
1.3       bowersj2  117: </p>
                    118: <p>
                    119: The initial CVS commands would be:
                    120: </p>
                    121: <blockquote>
                    122: <table bgcolor="#aaaaaa" border="1">
                    123: <tr><td>
                    124: <pre>
                    125: export CVSROOT=:pserver:USERNAME@zaphod.lite.msu.edu:/home/cvs 
                    126: cvs login 
                    127: cvs co loncapa
                    128: </pre>
                    129: </td></tr></table>
                    130: </blockquote>
                    131: <p>
                    132: For more information on using CVS, please visit
                    133: <a href="http://www.cvshome.org/">http://www.cvshome.org/</a>
                    134: or read <tt>loncom/build/readme.html</tt> after downloading
                    135: the current version of LON-CAPA as described above.
                    136: </p>
                    137: 
                    138: POSTLUDE
1.5       bowersj2  139: 
                    140: my $index = replaceText("Install LON-CAPA", "Install LON-CAPA",
                    141:     $content);
1.3       bowersj2  142: 
1.1       bowersj2  143: print INDEX $index;
                    144: close INDEX;
                    145: 
                    146: # Build the pages
                    147: for (@pages) {
                    148:     my ($title, $source) = @$_;
                    149: 
                    150:     # read in content
                    151:     open SOURCE, '<', $source.'.frag';
                    152:     $content = join '', <SOURCE>;
                    153:     close SOURCE;
                    154: 
                    155:     $content = replaceText($title, '<a href="/">Install LON-CAPA</a> &gt; ' . $title,
                    156: 			   $content);
                    157:     open DEST, '>', $source.'.html';
                    158:     print DEST $content;
                    159:     close DEST;
                    160: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>