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

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: 
1.23      albertel   13: Basically, there's a few comments in shell.hemp that we replace with
1.1       bowersj2   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.21      albertel   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.19      raeburn    30:               ['SuSE Linux Professional 9.2 Install', 'suse9.2_install'],
1.25    ! raeburn    31:               ['SuSE Linux Professional 9.3 Install', 'suse9.3_install'],
1.21      albertel   32: #	      ['Manual Install from Tarballs', 'manual_install'],
1.1       bowersj2   33: 	      ['Upgrading from Previous LON-CAPA install', 'upgrade'],
                     34: 	      ['LON-CAPA License (Gnu Public License)', 'license']
                     35: 	      );
1.22      albertel   36: my @other_pages = ( 
1.23      albertel   37: 		    ['Developer Information', 'dev'],
                     38: 		    ['Configuration Information', 'config'],
1.22      albertel   39: 		    );
1.1       bowersj2   40: 
                     41: open SHELL, '<', "shell.html";
                     42: my $shell = join '', <SHELL>;
                     43: $shell =~ s/\r/\n/g;
                     44: 
                     45: # Call with: The title, breadcrumb, and content
                     46: sub replaceText {
                     47:     my ($title, $breadcrumb, $content) = @_;
                     48: 
                     49:     my $page = $shell;
                     50:     $page =~ s/\<!-- *title *--\>/$title/g;
                     51:     $page =~ s/\<!-- *breadcrumb *--\>/$breadcrumb/g;
                     52:     $page =~ s/\<!-- *content *--\>/$content/g;
                     53: 
                     54:     return $page;
                     55: }
                     56: 
                     57: # Do the index page
                     58: 
                     59: open INDEX, '>', "index.html";
1.23      albertel   60: my $content = <<PRELUDE; 
                     61: 
                     62: <p>LON-CAPA is based upon a lot of Open Source modules, so it's
                     63: important to have the right environment on your computer. This is most
                     64: easily done by installing on a dedicated machine while installing the
                     65: operating system.</p>
                     66: 
                     67: <p>The configuring of LON-CAPA is part of the install process of the
1.24      albertel   68: software. However, In case something needs to be altered, or isn't
                     69: working, here is some <a href="config.html">information on configuring
1.23      albertel   70: LON-CAPA</a>.</p>
1.1       bowersj2   71: 
1.3       bowersj2   72: <hr />
1.1       bowersj2   73: PRELUDE
                     74: 
                     75: $content .= "<ul>\n";
                     76: for (@pages) {
                     77:     $content .= "<li><a href='$_->[1].html'>$_->[0]</a></li>\n";
                     78: }
                     79: 
                     80: $content .= "</ul>\n";
                     81: 
1.4       bowersj2   82: $content .= <<'POSTLUDE';
1.3       bowersj2   83: <hr />
                     84: <a name="download" />
                     85: <h3>Downloading LON-CAPA</h3>
                     86: 
                     87: <p>
1.10      albertel   88: <b>Current Production Release is Version LATESTVERSION.
1.3       bowersj2   89: This version was released on LATESTDATE.</b>
                     90: </p>
                     91: <p>
1.10      albertel   92: You can download the <b>most current production version of LON-CAPA</b> at
1.3       bowersj2   93: <a href="http://install.lon-capa.org/versions/loncapa-current.tar.gz">
                     94: http://install.lon-capa.org/versions/loncapa-current.tar.gz</a>
                     95: (version LATESTVERSION).
                     96: </p>
1.8       albertel   97: TESTINGRELEASE_START
                     98: <p>
1.10      albertel   99: <b>Current Testing Release is Version LATESTTESTINGVERSION.
1.9       albertel  100: This version was released on LATESTTESTINGDATE.</b>
                    101: </p>
                    102: <p>
1.8       albertel  103: You can download the <b>testing version of the upcoming LON-CAPA</b> at
                    104: <a href="http://install.lon-capa.org/versions/loncapa-testing.tar.gz">
                    105: http://install.lon-capa.org/versions/loncapa-testing.tar.gz</a>
1.9       albertel  106: (version LATESTTESTINGVERSION).
1.8       albertel  107: </p>
                    108: TESTINGRELEASE_END
1.3       bowersj2  109: 
1.22      albertel  110: <hr />
1.3       bowersj2  111: POSTLUDE
1.5       bowersj2  112: 
1.22      albertel  113: $content .= "<ul>\n";
                    114: for (@other_pages) {
                    115:     $content .= "<li><a href='$_->[1].html'>$_->[0]</a></li>\n";
                    116: }
                    117: 
                    118: $content .= "</ul>\n";
                    119: 
1.5       bowersj2  120: my $index = replaceText("Install LON-CAPA", "Install LON-CAPA",
                    121:     $content);
1.3       bowersj2  122: 
1.1       bowersj2  123: print INDEX $index;
                    124: close INDEX;
                    125: 
                    126: # Build the pages
1.22      albertel  127: for (@pages,@other_pages) {
1.1       bowersj2  128:     my ($title, $source) = @$_;
                    129: 
                    130:     # read in content
                    131:     open SOURCE, '<', $source.'.frag';
                    132:     $content = join '', <SOURCE>;
                    133:     close SOURCE;
                    134: 
                    135:     $content = replaceText($title, '<a href="/">Install LON-CAPA</a> &gt; ' . $title,
                    136: 			   $content);
                    137:     open DEST, '>', $source.'.html';
                    138:     print DEST $content;
                    139:     close DEST;
                    140: }

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