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

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: 
1.32      raeburn    24: my @pages = (
1.38      raeburn    25:               ['Fedora 9 Install', 'F9_install'],
1.35      raeburn    26:               ['Fedora 8 Install', 'F8_install'], 
1.34      raeburn    27:               ['Fedora 7 Install', 'F7_install'],
1.32      raeburn    28:               ['Fedora Core 6 Install', 'FC6_install'], 
1.30      albertel   29: 	      ['Fedora Core 5 Install', 'FC5_install'],
1.32      raeburn    30: #             ['Fedora Core 4 Install', 'FC4_install'],
1.30      albertel   31: #             ['Fedora Core 3 Install', 'FC3_install'],
                     32: #	      ['Fedora Install', 'fedora_install'],
1.14      matthew    33: #	      ['Red Hat 7.3 Install', 'rh73'],
1.39    ! raeburn    34:               ['CentOS Linux 5 Install','centos5_install'],
1.33      raeburn    35:               ['Red Hat Enterprise Linux 5 Install','RHEL5_install'],
1.17      raeburn    36:               ['Red Hat Enterprise Linux 4 Install','RHEL4_install'],
1.36      raeburn    37:               ['SuSE Linux 10.3 Install', 'suse10.3_install'],
1.33      raeburn    38:               ['SuSE Linux 10.2 Install', 'suse10.2_install'],
1.31      raeburn    39:               ['SuSE Linux 10.1 Install', 'suse10.1_install'],
1.37      raeburn    40: #              ['SuSE Linux Professional 9.3 Install', 'suse9.3_install'],
1.33      raeburn    41: #              ['SuSE Linux Professional 9.2 Install', 'suse9.2_install'],
1.31      raeburn    42:               ['SuSE Linux Enterprise Server 10 Install', 'sles10_install'],
1.26      raeburn    43:               ['SuSE Linux Enterprise Server 9 Install', 'sles9_install'],
1.21      albertel   44: #	      ['Manual Install from Tarballs', 'manual_install'],
1.1       bowersj2   45: 	      ['Upgrading from Previous LON-CAPA install', 'upgrade'],
                     46: 	      ['LON-CAPA License (Gnu Public License)', 'license']
                     47: 	      );
1.29      albertel   48: 
                     49: my @testing_pages = ( 
                     50: 		      );
1.22      albertel   51: my @other_pages = ( 
1.23      albertel   52: 		    ['Developer Information', 'dev'],
                     53: 		    ['Configuration Information', 'config'],
1.22      albertel   54: 		    );
1.1       bowersj2   55: 
                     56: open SHELL, '<', "shell.html";
                     57: my $shell = join '', <SHELL>;
                     58: $shell =~ s/\r/\n/g;
                     59: 
                     60: # Call with: The title, breadcrumb, and content
                     61: sub replaceText {
1.27      albertel   62:     my ($title, $links, $breadcrumb, $content) = @_;
1.1       bowersj2   63: 
                     64:     my $page = $shell;
                     65:     $page =~ s/\<!-- *title *--\>/$title/g;
1.27      albertel   66:     $page =~ s/\<!-- *links *--\>/$links/g;
1.1       bowersj2   67:     $page =~ s/\<!-- *breadcrumb *--\>/$breadcrumb/g;
                     68:     $page =~ s/\<!-- *content *--\>/$content/g;
                     69: 
                     70:     return $page;
                     71: }
                     72: 
                     73: # Do the index page
                     74: 
                     75: open INDEX, '>', "index.html";
1.23      albertel   76: my $content = <<PRELUDE; 
                     77: 
                     78: <p>LON-CAPA is based upon a lot of Open Source modules, so it's
                     79: important to have the right environment on your computer. This is most
                     80: easily done by installing on a dedicated machine while installing the
                     81: operating system.</p>
                     82: 
                     83: <p>The configuring of LON-CAPA is part of the install process of the
1.24      albertel   84: software. However, In case something needs to be altered, or isn't
                     85: working, here is some <a href="config.html">information on configuring
1.23      albertel   86: LON-CAPA</a>.</p>
1.1       bowersj2   87: 
1.3       bowersj2   88: <hr />
1.1       bowersj2   89: PRELUDE
                     90: 
                     91: $content .= "<ul>\n";
                     92: for (@pages) {
                     93:     $content .= "<li><a href='$_->[1].html'>$_->[0]</a></li>\n";
                     94: }
                     95: 
                     96: $content .= "</ul>\n";
                     97: 
1.30      albertel   98: my $testing_content = '';
1.29      albertel   99: if (@testing_pages) {
                    100:     $testing_content .= "<hr/><p>Installation on the following systems requires the use of a testing release of LON-CAPA.</p>\n";
                    101:     $testing_content .= "<ul>\n";
                    102:     for (@testing_pages) {
                    103: 	$testing_content .= "<li><a href='$_->[1].html'>$_->[0]</a></li>\n";
                    104:     }
                    105:     $testing_content .= "</ul>\n";
                    106: }
                    107: 
                    108: 
                    109: $content .= <<"POSTLUDE";
1.3       bowersj2  110: <hr />
                    111: <a name="download" />
                    112: <h3>Downloading LON-CAPA</h3>
                    113: 
                    114: <p>
1.10      albertel  115: <b>Current Production Release is Version LATESTVERSION.
1.3       bowersj2  116: This version was released on LATESTDATE.</b>
                    117: </p>
                    118: <p>
1.10      albertel  119: You can download the <b>most current production version of LON-CAPA</b> at
1.3       bowersj2  120: <a href="http://install.lon-capa.org/versions/loncapa-current.tar.gz">
                    121: http://install.lon-capa.org/versions/loncapa-current.tar.gz</a>
                    122: (version LATESTVERSION).
                    123: </p>
1.8       albertel  124: TESTINGRELEASE_START
                    125: <p>
1.10      albertel  126: <b>Current Testing Release is Version LATESTTESTINGVERSION.
1.9       albertel  127: This version was released on LATESTTESTINGDATE.</b>
                    128: </p>
                    129: <p>
1.8       albertel  130: You can download the <b>testing version of the upcoming LON-CAPA</b> at
                    131: <a href="http://install.lon-capa.org/versions/loncapa-testing.tar.gz">
                    132: http://install.lon-capa.org/versions/loncapa-testing.tar.gz</a>
1.9       albertel  133: (version LATESTTESTINGVERSION).
1.8       albertel  134: </p>
1.29      albertel  135: $testing_content
1.8       albertel  136: TESTINGRELEASE_END
1.3       bowersj2  137: 
1.22      albertel  138: <hr />
1.3       bowersj2  139: POSTLUDE
1.5       bowersj2  140: 
1.30      albertel  141: open(RELEASE, '<', "release.frag");
                    142: $content .= join('',<RELEASE>);
                    143: close(RELEASE);
                    144: 
1.22      albertel  145: $content .= "<ul>\n";
                    146: for (@other_pages) {
                    147:     $content .= "<li><a href='$_->[1].html'>$_->[0]</a></li>\n";
                    148: }
                    149: 
                    150: $content .= "</ul>\n";
                    151: 
1.27      albertel  152: $links='<link rel="alternate" type="application/rss+xml" title="CVS RSS" href="loncapa.rss" />';
                    153: 
                    154: my $index = replaceText("Install LON-CAPA", $links, "Install LON-CAPA",
                    155: 			$content);
1.3       bowersj2  156: 
1.1       bowersj2  157: print INDEX $index;
                    158: close INDEX;
                    159: 
                    160: # Build the pages
1.29      albertel  161: for (@pages,@other_pages,@testing_pages) {
1.1       bowersj2  162:     my ($title, $source) = @$_;
                    163: 
                    164:     # read in content
                    165:     open SOURCE, '<', $source.'.frag';
                    166:     $content = join '', <SOURCE>;
                    167:     close SOURCE;
                    168: 
1.27      albertel  169:     $content = replaceText($title, '', '<a href="/">Install LON-CAPA</a> &gt; ' . $title,
1.1       bowersj2  170: 			   $content);
                    171:     open DEST, '>', $source.'.html';
                    172:     print DEST $content;
                    173:     close DEST;
                    174: }

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