# Scandoc template file.
#
# This is an example set of templates that is designed to create several
# different kinds of index files. It generates a "master index" which intended
# for use with a frames browser; A "package index" which is the root page of
# the index, and then "package files" containing documentation for all of the
# classes within a single package.
######################################################################
## For quick and superficial customization,
## simply change these variables
$project_name = 'Apache WebApp';
$copyright = '2000-2001 The Apache Software Foundation';
######################################################################
## Begin generating frame index file.
file "index.html";
>>
$project_name
<<
######################################################################
## Begin generating master index file (left-hand frame).
file "master.html";
>>
$project_name - Master Index
<<
######################################################################
## Begin generating package index file
file "packages.html";
>>
$project_name - Packages List
$project_name - Packages List |
Packages: |
<<
## For each package, generate an index entry.
foreach $p (packages()) {
$_ = $p->url;
s/\s/_/g;
>>
|
$(p.name) |
<<
}
>>
|
|
Copyright © $copyright. All Rights Reserved.
Generated by ScanDoc $majorVersion.$minorVersion
on $date
|
<<
######################################################################
## Generate "To-do list"
file "todolist.html";
>>
$project_name - To-Do List
$project_name - Packages List |
<<
if (&todolistFiles()) {
foreach $f (&todolistFiles()) {
my @m = &todolistEntries( $f );
if ($f =~ /([^\/]+)$/) { $f = $1; }
>>
|
$f notes: |
|
<<
foreach $text (@m) {
if ($text) {
>>
$text
<<
}
}
>>
|
<<
}
}
>>
|
|
Copyright © $copyright. All Rights Reserved.
Generated by ScanDoc $majorVersion.$minorVersion
on $date
|
<<
######################################################################
## Generate individual files for each package.
my $p;
foreach $p (packages()) {
$_ = $p->name;
s/\s/_/g;
file $_ . ".html";
>>
$project_name - Package $(p.name)
$project_name - Package $(p.name) |
<<
## Generate class and member index at the top of the file.
>>
Classes: |
<<
foreach $e ($p->classes()) {
$_ = $e->url;
s/\s/_/g;
>>
|
- $(e.fullname)
<<
# Output class member index
if ($e->members()) {
foreach $m ($e->members()) {
$_ = $m->url;
s/\s/_/g;
>>
- $(m.fullname)
<<
}
}
>>
|
<<
}
>>
Global Variables: |
<<
foreach $e ($p->globalvars()) {
$_ = $e->url;
s/\s/_/g;
>>
|
$(e.fullname) |
<<
}
>>
Global Functions: |
<<
foreach $e ($p->globalfuncs()) {
$_ = $e->url;
s/\s/_/g;
>>
|
$(e.fullname) |
<<
}
>>
|
<<
## Generate detailed class documentation
foreach $c ($p->classes()) {
## Output searchable keyword list
if ($c->keywords()) {
print "\n";
}
>>
Class: $(c.fullname) |
<<
# Output main class description
>>
Description |
$(c.description) |
<<
# Output author tag
if ($c->author()) {
>>
Author |
$(c.author) |
<<
}
# Output package version
if ($c->version()) {
>>
Version |
$(c.version) |
<<
}
# Output Source file
if ($c->sourcefile()) {
>>
Source File |
$(c.sourcefile) |
<<
}
# Output "see also" information
if ($c->seealso()) {
>>
See Also |
<<
my @r = ();
foreach $a ($c->seealso()) {
my $name = $a->name();
if ($url = $a->url()) {
$_ = $url;
s/\s/_/g;
push @r, "$name";
}
else { push @r, $name; }
}
print join( ', ', @r );
>>
|
<<
}
# Output base class list
if ($c->baseclasses()) {
>>
Base Classes |
<<
my @t = ();
foreach $b ($c->baseclasses()) {
my $name = $b->name();
if ($url = $b->url()) {
$_ = $url;
s/\s/_/g;
push @t, "$name";
}
else { push @t, $name; }
}
print join( ', ', @t );
>>
|
<<
}
# Output subclasses list
if ($c->subclasses()) {
>>
Sub Classes |
<<
my @t = ();
foreach $s ($c->subclasses()) {
my $name = $s->name();
if ($url = $s->url()) {
$_ = $url;
s/\s/_/g;
push @t, "$name";
}
else { push @t, $name; }
}
print join( ', ', @t );
>>
|
<<
}
# Output class member variable documentation
if ($c->membervars()) {
>>
Class Variables |
<<
foreach $m ($c->membervars()) { &variable( $m ); }
}
# Output class member function documentation
if ($c->memberfuncs()) {
>>
Class Functions |
<<
foreach $m ($c->memberfuncs()) { &function( $m ); }
}
>>
|
<<
}
# Output global variables
if ($p->globalvars()) {
>>
Global Variables: |
<<
foreach $m ($p->globalvars()) { &variable( $m ); }
>>
|
<<
}
# Output global functions
if ($p->globalfuncs()) {
>>
Global Functions: |
<<
foreach $m ($p->globalfuncs()) { &function( $m ); }
>>
|
<<
}
>>
<<
} # end of foreach (packages) loop
######################################################################
## Subroutine to generate documentation for a member function or global function
sub function {
local ($f) = @_;
>>
$(f.fullname)
|
<<
if ($f->keywords()) {
>>
<<
}
>>
-
$(f.description)
<<
if ($f->params()) {
>>
- Parameters
<<
foreach $a ($f->params()) {
>>
-
$(a.name):
$(a.description)
<<
}
}
if ($f->returnValue()) {
>>
- Return Value
- $(f.returnValue)
<<
}
if ($f->exceptions()) {
>>
- Exceptions
<<
foreach $a ($f->exceptions()) {
>>
-
$(a.name):
$(a.description)
<<
}
}
if ($f->seealso()) {
>>
- See Also
-
<<
my @r = ();
foreach $a ($f->seealso()) {
my $name = $a->name();
if ($url = $a->url()) {
$_ = $url;
s/\s/_/g;
push @r, "$name";
}
else { push @r, $name; }
}
print join( ', ', @r );
>>
<<
}
>>
|
<<
}
######################################################################
## Subroutine to generate documentation for a member variable or global variable.
sub variable {
local ($v) = @_;
>>
$(v.fullname)
|
<<
if ($v->keywords()) {
>>
<<
}
>>
-
$(v.description)
<<
if ($v->seealso()) {
>>
- See Also
-
<<
my @r = ();
foreach $a ($v->seealso()) {
my $name = $a->name();
if ($url = $a->url()) {
$_ = $url;
s/\s/_/g;
push @r, "$name";
}
else { push @r, $name; }
}
print join( ', ', @r );
>>
<<
}
>>
|
<<
}