File:  [LON-CAPA] / doc / build / generate_web_pages.pl
Revision 1.9: download - view: text, annotated - select for diffs
Tue Jul 6 19:11:08 2004 UTC (19 years, 10 months ago) by albertel
Branches: MAIN
CVS tags: HEAD
- update testing message

    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 = ( 
   25: 	      ['Red Hat 7.3 Install', 'rh73'],
   26: 	      ['Fedora Install', 'fedora_install'],
   27: 	      ['Manual Install from Tarballs', 'manual_install'],
   28: 	      ['Upgrading from Previous LON-CAPA install', 'upgrade'],
   29: 	      ['Post-installation Configuration', 'config'],
   30: 	      ['LON-CAPA License (Gnu Public License)', 'license']
   31: 	      );
   32: 
   33: open SHELL, '<', "shell.html";
   34: my $shell = join '', <SHELL>;
   35: $shell =~ s/\r/\n/g;
   36: 
   37: # Call with: The title, breadcrumb, and content
   38: sub replaceText {
   39:     my ($title, $breadcrumb, $content) = @_;
   40: 
   41:     my $page = $shell;
   42:     $page =~ s/\<!-- *title *--\>/$title/g;
   43:     $page =~ s/\<!-- *breadcrumb *--\>/$breadcrumb/g;
   44:     $page =~ s/\<!-- *content *--\>/$content/g;
   45: 
   46:     return $page;
   47: }
   48: 
   49: # Do the index page
   50: 
   51: open INDEX, '>', "index.html";
   52: my $content = <<PRELUDE;
   53: <p>LON-CAPA is based upon a lot of Open Source modules, so it's important
   54: to have the right environment on your computer. Since it will frequently 
   55: be the case that LON-CAPA will be going onto a dedicated machine, we've 
   56: included instructions for installing LON-CAPA concurrently with new
   57: installations of some of the popular Linux distributions.</p>
   58: 
   59: <p>A tarball installation is also available for those who wish to 
   60: install on other distributions. Currently, Apache 1.x is required;
   61: LON-CAPA does not yet run on 2.0.</p>
   62: 
   63: <p>For all distributions, please see how to 
   64: <a href="config.html">configure the server after installation</a>.</p>
   65: <hr />
   66: PRELUDE
   67: 
   68: $content .= "<ul>\n";
   69: for (@pages) {
   70:     $content .= "<li><a href='$_->[1].html'>$_->[0]</a></li>\n";
   71: }
   72: 
   73: $content .= "</ul>\n";
   74: 
   75: $content .= <<'POSTLUDE';
   76: <hr />
   77: <a name="download" />
   78: <h3>Downloading LON-CAPA</h3>
   79: 
   80: <p>
   81: <b>Current Release is Version LATESTVERSION.
   82: This version was released on LATESTDATE.</b>
   83: </p>
   84: <p>
   85: You can download the <b>most current version of LON-CAPA</b> at
   86: <a href="http://install.lon-capa.org/versions/loncapa-current.tar.gz">
   87: http://install.lon-capa.org/versions/loncapa-current.tar.gz</a>
   88: (version LATESTVERSION).
   89: </p>
   90: TESTINGRELEASE_START
   91: <p>
   92: <b>Current Release is Version LATESTTESTINGVERSION.
   93: This version was released on LATESTTESTINGDATE.</b>
   94: </p>
   95: <p>
   96: You can download the <b>testing version of the upcoming LON-CAPA</b> at
   97: <a href="http://install.lon-capa.org/versions/loncapa-testing.tar.gz">
   98: http://install.lon-capa.org/versions/loncapa-testing.tar.gz</a>
   99: (version LATESTTESTINGVERSION).
  100: </p>
  101: TESTINGRELEASE_END
  102: <p>
  103: The <b>development release of LON-CAPA</b> is at:
  104: <a href="http://install.lon-capa.org/versions/loncapa-unstable.tar.gz">
  105: http://install.lon-capa.org/versions/loncapa-unstable.tar.gz</a>.
  106: </p>
  107: <p>
  108: To view the code development history of LON-CAPA, you can access a <a
  109: href="http://zaphod.lite.msu.edu/cgi-bin/cvsweb.cgi/">web version</a>
  110: of our CVS respository. Otherwise, please contact Helen (<a
  111: href="mailto:helen@lon-capa.org"> helen@lon-capa.org</a>) to request a
  112: CVS USERNAME.
  113: </p>
  114: <p>
  115: The initial CVS commands would be:
  116: </p>
  117: <blockquote>
  118: <table bgcolor="#aaaaaa" border="1">
  119: <tr><td>
  120: <pre>
  121: export CVSROOT=:pserver:USERNAME@zaphod.lite.msu.edu:/home/cvs 
  122: cvs login 
  123: cvs co loncapa
  124: </pre>
  125: </td></tr></table>
  126: </blockquote>
  127: <p>
  128: For more information on using CVS, please visit
  129: <a href="http://www.cvshome.org/">http://www.cvshome.org/</a>
  130: or read <tt>loncom/build/readme.html</tt> after downloading
  131: the current version of LON-CAPA as described above.
  132: </p>
  133: 
  134: POSTLUDE
  135: 
  136: my $index = replaceText("Install LON-CAPA", "Install LON-CAPA",
  137:     $content);
  138: 
  139: print INDEX $index;
  140: close INDEX;
  141: 
  142: # Build the pages
  143: for (@pages) {
  144:     my ($title, $source) = @$_;
  145: 
  146:     # read in content
  147:     open SOURCE, '<', $source.'.frag';
  148:     $content = join '', <SOURCE>;
  149:     close SOURCE;
  150: 
  151:     $content = replaceText($title, '<a href="/">Install LON-CAPA</a> &gt; ' . $title,
  152: 			   $content);
  153:     open DEST, '>', $source.'.html';
  154:     print DEST $content;
  155:     close DEST;
  156: }

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