<< # 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. ############################################################################### ## Defaults for look and feel if ($project eq "") { $project = "WebApp Library"; } if ($copyright eq "") { $copyright = "2001, The Apache Software Foundation"; } if ($body_bgcolor eq "") { $body_bgcolor = '#ffffff'; } if ($body_text eq "") { $body_text = '#000000'; } if ($body_link eq "") { $body_link = '#0000ff'; } if ($body_vlink eq "") { $body_vlink = '#0000ff'; } if ($body_alink eq "") { $body_alink = '#0000ff'; } ############################################################################### # Generate the frameset index # ############################################################################### file "index.html"; @p = packages(); $_ = @p[0]->url; s/\s/_/g; y/[A-Z]/[a-z]/; >> $project API Documentation << ############################################################################### # Generate the packages list # ############################################################################### file "packages.html"; >> $project - Packages List $project packages: << foreach $p (packages()) { $_ = $p->url; s/\s/_/g; y/[A-Z]/[a-z]/; >> << } >>
   
  $(p.name)

Copyright © $copyright.
All Rights Reserved.
<< ############################################################################### # Generate the packages table of content for each package # ############################################################################### foreach $p (packages()) { $_ = $p->url; s/\s/_/g; y/[A-Z]/[a-z]/; file "pkg.$_"; >> $project - Packages List $(p.name) package: << # Generate a list of classes included in this package foreach $e ($p->classes()) { $_ = $e->url; s/\s/_/g; y/[A-Z]/[a-z]/; >> << } # Generate a list of all global functions included in this package if ($p->globalfuncs()) { >> << foreach $e ($p->globalfuncs()) { $_ = $e->url; s/\s/_/g; y/[A-Z]/[a-z]/; >> << } } else { >> << } # Generate a list of all global variables included in this package if ($p->globalvars()) { >> << foreach $e ($p->globalvars()) { $_ = $e->url; s/\s/_/g; y/[A-Z]/[a-z]/; >> << } } else { >> << } # Copyright statement at the bottom >>
   
Classes:
  $(e.fullname)
Global Functions:
  $(e.fullname)
No Global Functions defined.
Global Variables:
  $(e.fullname)
No Global Variables defined.

Copyright © $copyright.
All Rights Reserved.
<< } ############################################################################### # Generate the packages detailed description for each package # ############################################################################### foreach $p (packages()) { $_ = $p->url; s/\s/_/g; y/[A-Z]/[a-z]/; file "doc.$_"; >> $project - Packages List
$project $(p.name) package

<< # Generate a TOC of all classes at the top of the page foreach $e ($p->classes()) { $_ = $e->url; s/\s/_/g; y/[A-Z]/[a-z]/; >> << } # Continue with the global functions TOC if ($p->globalfuncs()) { >>
Classes
$(e.fullname)
<< if ($e->members()) { foreach $m ($e->members()) { $_ = $m->url; s/\s/_/g; y/[A-Z]/[a-z]/; >>
$(m.fullname)
<< } } >>

<< foreach $e ($p->globalfuncs()) { $_ = $e->url; s/\s/_/g; y/[A-Z]/[a-z]/; >> << } } # And then finish with the global variables TOC if ($p->globalvars()) { >>
Global Functions
$(e.fullname)

<< foreach $e ($p->globalvars()) { $_ = $e->url; s/\s/_/g; y/[A-Z]/[a-z]/; >> << } } >>
Global Variables
$(e.fullname)

<< # Then generate the detail for each class in this package foreach $e ($p->classes()) { $_ = $e->url; s/\s/_/g; y/[A-Z]/[a-z]/; >>
Class "$(e.name)" Detail:
$(e.name)
$(e.fullname) {
<< # Generate a code-like representation of the class if ($e->members()) { foreach $m ($e->members()) { >>
$(m.fullname);
<< } } >>
};

$(e.description)

<< # If we have functions, output them if ($e->memberfuncs()) { >>
Class "$(e.name)" Functions:
<< foreach $m ($e->memberfuncs()) { $_ = join("-",$e->name,$m->name); s/\s/_/g; y/[A-Z]/[a-z]/; >> << &function($m); } } # If we have variables, output them if ($e->membervars()) { >>
Class "$(e.name)" Variables:
<< foreach $m ($e->membervars()) { $_ = join("-",$e->name,$m->name); s/\s/_/g; y/[A-Z]/[a-z]/; >>
<< &variable($m); } } } # Output detailed information for each global function if ($p->globalfuncs()) { >>
Global Functions Detail:
<< foreach $e ($p->globalfuncs()) { $_ = $e->name; s/\s/_/g; y/[A-Z]/[a-z]/; >>
<< &function($e); } } # Then write detailed information for each global variable if ($p->globalvars()) { >>
Global Variables Detail:
<< foreach $e ($p->globalvars()) { $_ = $e->name; s/\s/_/g; y/[A-Z]/[a-z]/; >>
<< &variable($e); } } >>
Copyright © $copyright.
All Rights Reserved.
Generated with
ScanDoc $majorVersion.$minorVersion on $date
<< } # Write out the detailed description of a function sub function { local ($m) = @_; # Output the function name and description >> $(m.name)
$(m.fullname);
$(m.description)
<< # Process all parameters (one by one) if ($m->params()) { >>
Parameters
<< foreach $a ($m->params()) { >>
$(a.name) - $(a.description)
<< } } # Check for a return value if ($m->returnValue()) { >>
Return Value
$(m.returnValue)
<< } # Dig in for exceptions if ($m->exceptions()) { >>
Exceptions
<< foreach $a ($m->exceptions()) { >>
$(a.name) $(a.description)
<< } } # Close the list >>

<< } # Write out the detailed description of a variable sub variable { local ($m) = @_; # Output the variable name and description >> $(m.name)
$(m.fullname);
$(m.description)

<< }