2 # Scandoc template file.
4 # This is an example set of templates that is designed to create several
5 # different kinds of index files. It generates a "master index" which intended
6 # for use with a frames browser; A "package index" which is the root page of
7 # the index, and then "package files" containing documentation for all of the
8 # classes within a single package.
10 ######################################################################
12 ## For quick and superficial customization,
13 ## simply change these variables
15 $project_name = '[Apache]';
16 $company_logo = '<img src="../images/ScanDocBig.jpg">'; # change this to an image tag.
17 $copyright = '© 2000 [Apache Software Foundation]';
18 $image_directory = "../images/";
19 $bullet1_image = $image_directory . "ball1.gif";
20 $bullet2_image = $image_directory . "ball2.gif";
21 $bgcolor1 = "#FFFFFF";
22 $bgcolor2 = "#FFFFFF";
24 ######################################################################
26 ## Begin generating frame index file.
31 <meta http-equiv="Content-Type" content="text/html; iso-8859-1">
32 <title>$project_name</title>
34 <frameset cols="190,*">
35 <frame src="master.html" name="Master Index" noresize>
36 <frame src="packages.html" name="Documentation">
38 <body bgcolor="$bgcolor2" stylesrc="index.html">
39 <p>Some Documentation</p>
46 ######################################################################
48 ## Begin generating master index file (left-hand frame).
53 <title>Master Index</title>
55 <body bgcolor="$bgcolor1" text=#0000ff link=#0020ff vlink=#0020ff>
56 <center><img src="${image_directory}ScanDocSmall.jpg" border="0" /></center>
58 <a href="packages.html" target="Documentation">Master Index</a>
65 ## For each package, generate an index entry.
67 foreach $p (packages()) {
70 >><a href="$_" target="Documentation"><b>$(p.name)</b></a><br>
73 foreach $e ($p->classes()) {
76 >><li><a href="$_" target="Documentation">$(e.fullname)</a>
79 foreach $e ($p->globals()) {
82 >><li><a href="$_" target="Documentation">$(e.fullname)</a>
89 <a href="to-do.html" target="Documentation"><b>To-Do List</b></a><br>
97 ######################################################################
99 ## Begin generating package index file
101 file "packages.html";
104 <title>$project_name -- Packages</title>
106 <body bgcolor="$bgcolor2">
108 <center>$company_logo
109 <h1>Documentation for $project_name</h1>
111 <h2>Package List</h2>
114 ## For each package, generate an index entry.
116 foreach $p (packages()) {
119 >><a href = "$_">$(p.name)</a><br>
127 Generated by <a href="$scandocURL"><b>ScanDoc $majorVersion.$minorVersion</b></a><br>
128 Last Updated: $date<br>
134 ######################################################################
136 ## Generate "To-do list"
141 <title>$project_name -- To-Do list</title>
143 <body bgcolor="$bgcolor2">
147 <h1>To-do list for $project_name</h1>
150 if (&todolistFiles()) {
153 foreach $f (&todolistFiles()) {
154 my @m = &todolistEntries( $f );
155 if ($f =~ /([^\/]+)$/) { $f = $1; }
160 print "<li>", &processDescription( $text ), "\n";
171 Generated by <a href="$scandocURL"><b>ScanDoc $majorVersion.$minorVersion</b></a><br>
172 Last Updated: $date<br>
177 ######################################################################
179 ## Generate individual files for each package.
182 foreach $p (packages()) {
183 file $p->name() . ".html";
186 <title>$project_name -- $(p.name)</title>
188 <body bgcolor="$bgcolor2">
190 <font size=6><b>$project_name</b></font>
194 <h2>Package Name: $(p.name)</h2>
198 ## Generate class and member index at the top of the file.
200 foreach $c ($p->classes()) {
201 >><h3><img src="$bullet1_image" width=18 height=17 align=texttop>
202 <a href="$(c.url)">$(c.fullname)</h3></a>
205 foreach $m ($c->members()) {
206 >><li><a href="$(m.url)">$(m.longname)</a>
217 ## Generate detailed class documentation
218 foreach $c ($p->classes()) {
219 ## Output searchable keyword list
220 if ($c->keywords()) {
221 print "<!-- ", $c->keywords(), " -->\n";
225 <a name="$(c.anchor)"></a>
226 <h1>$(c.fullname)</h1>
227 <table bgcolor="ffffff" border="0" cellspacing="4">
229 <th align=center colspan=2>
236 >><tr><th width=20% align=right>Author:</th><<
237 >><td>$(c.author)</td></tr><<
240 # Output package version
242 >><tr><th width=20% align=right>Version:</th><<
243 >><td>$(c.version)</td></tr><<
247 if ($c->sourcefile()) {
248 >><tr><th width=20% align=right>Source:</th><<
249 >><td>$(c.sourcefile)</td></tr><<
252 # Output base class list
253 if ($c->baseclasses()) {
254 >><tr><th width=20% align=right>Base classes:</th>
257 foreach $b ($c->baseclasses()) {
258 my $name = $b->name();
259 if ($url = $b->url()) {
260 push @t, "<a href=\"$url\">$name</a>";
262 else { push @t, $name; }
264 print join( ', ', @t );
269 # Output subclasses list
270 if ($c->subclasses()) {
271 >><tr><th width=20% align=right>Subclasses:</th>
274 foreach $s ($c->subclasses()) {
275 my $name = $s->name();
276 if ($url = $s->url()) {
277 push @t, "<a href=\"$url\">$name</a>";
279 else { push @t, $name; }
281 print join( ', ', @t );
285 # Output main class description
290 print &processDescription( $c->description() );
292 # Output "see also" information
294 >><p><dt><b>See Also</b><dd>
297 foreach $a ($c->seealso()) {
298 my $name = $a->name();
299 if ($url = $a->url()) {
300 push @r, "<a href=\"$url\">$name</a>";
302 else { push @r, $name; }
304 print join( ',', @r );
309 # Output class member index
311 print "<h2>Member Index</h2>\n";
313 foreach $m ($c->members()) {
314 >><li><a href="$(m.url)">$(m.fullname)</a>
320 # Output class member variable documentation
321 if ($c->membervars()) {
322 print "<h2>Class Variables</h2>\n";
323 print "<blockquote>\n";
324 foreach $m ($c->membervars()) { &variable( $m ); }
325 print "</blockquote>\n";
328 # Output class member function documentation
329 if ($c->memberfuncs()) {
330 print "<h2>Class Methods</h2>\n";
331 print "<blockquote>\n";
332 foreach $m ($c->memberfuncs()) { &function( $m ); }
333 print "</blockquote>\n";
337 # Output global variables
338 if ($p->globalvars()) {
339 >><h2>Global Variables</h2>
342 foreach $m ($p->globalvars()) { &variable( $m ); }
343 print "</blockquote>\n";
346 # Output global functions
347 if ($p->globalfuncs()) {
348 >><h2>Global Functions</h2>
351 foreach $m ($p->globalfuncs()) { &function( $m ); }
352 print "</blockquote>\n";
358 Generated by <a href="$scandocURL"><b>ScanDoc $majorVersion.$minorVersion</b></a><br>
359 Last Updated: $date<br>
363 } # end of foreach (packages) loop
365 ######################################################################
367 ## Subroutine to generate documentation for a member function or global function
372 if ($f->keywords()) {
373 >><!-- $(f.keywords) -->
377 <a name="$(f.anchor)"></a>
380 <b><img src="$bullet2_image" width=19 height=17 align=texttop>$(f.fullname);</b>
383 print &processDescription( $f->description() );
389 <dt><b>Parameters</b><dd>
392 foreach $a ($f->params()) {
393 >><tr valign=top><th align=right>
395 print &processDescription( $a->description() );
403 if ($f->returnValue()) {
404 >><dt><b>Return Value</b>
406 print &processDescription( $f->returnValue() );
410 if ($f->exceptions()) {
411 >><dt><b>Exceptions</b><dd>
412 <table width=85%><tr><td colspan=2><hr size=3></td></tr>
414 foreach $a ($f->exceptions()) {
415 >><tr valign=top><th align=right>
417 print &processDescription( $a->description() );
421 >><tr><td colspan=2><hr size=3></td></tr></table>
426 >><dt><b>See Also</b><dd>
429 foreach $a ($f->seealso()) {
430 my $name = $a->name();
431 if ($url = $a->url()) {
432 push @r, "<a href=\"$url\">$name</a>";
434 else { push @r, $name; }
436 print join( ',', @r );
443 ######################################################################
445 ## Subroutine to generate documentation for a member variable or global variable.
450 if ($v->keywords()) {
451 print "<!-- $(v.keywords) -->";
455 <a name="$(v.name)"></a>
457 <b><img src="$bullet2_image" width=19 height=17 align=texttop>$(v.fullname);</b>
459 <<print &processDescription( $v->description() );>>
463 >><dt><b>See Also</b><dd>
466 foreach $a ($v->seealso()) {
467 if ($comma) { print ","; }
469 >><a href="$(a.url)">$(a.name)</a>
479 ######################################################################
481 sub processDescription {
484 s/^\s+//; # Remove whitespace from beginning
485 s/\s+$/\n/; # Remove whitespace from end
486 s/\n\n/<p>\n/g; # Replace multiple CR's with paragraph markers
487 s:\@heading(.*)\n:<p><h2>$1</h2>:; # Handle heading text
489 # Handle embedded image tags
490 s:\@caution:<p><img src=\"${image_directory}/caution.gif\" align=left>:;
491 s:\@warning:<p><img src=\"${image_directory}/warning.gif\" align=left>:;
492 s:\@bug:<p><img src=\"${image_directory}/bug.gif\">:;
493 s:\@tip:<p><img src=\"${image_directory}/tip.gif\">:;