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