<< # 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 << ## For each package, generate an index entry. foreach $p (packages()) { $_ = $p->url; s/\s/_/g; >> << foreach $e ($p->classes()) { $_ = $e->url; s/\s/_/g; >> << } >> << foreach $e ($p->globalvars()) { $_ = $e->url; s/\s/_/g; >> << } >> << foreach $e ($p->globalfuncs()) { $_ = $e->url; s/\s/_/g; >> << } } >>
$project_name
Master Index:
  Packages list
  To-Do list
 
$(p.name)
Classes:
  $(e.fullname)
Global Variables:
  $(e.fullname)
Global Functions:
  $(e.fullname)
 
Copyright © $copyright. All Rights Reserved.
Generated by ScanDoc $majorVersion.$minorVersion on $date
<< ###################################################################### ## Begin generating package index file file "packages.html"; >> $project_name - Packages List << ## For each package, generate an index entry. foreach $p (packages()) { $_ = $p->url; s/\s/_/g; >> << } >>
$project_name - Packages List
Packages:
  $(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 << if (&todolistFiles()) { foreach $f (&todolistFiles()) { my @m = &todolistEntries( $f ); if ($f =~ /([^\/]+)$/) { $f = $1; } >> << } } >>
$project_name - Packages List
 
$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) << ## Generate class and member index at the top of the file. >> << foreach $e ($p->classes()) { $_ = $e->url; s/\s/_/g; >> << } >> << foreach $e ($p->globalvars()) { $_ = $e->url; s/\s/_/g; >> << } >> << foreach $e ($p->globalfuncs()) { $_ = $e->url; s/\s/_/g; >> << } >>
$project_name - Package $(p.name)
Classes:
 
$(e.fullname)
<< # Output class member index if ($e->members()) { foreach $m ($e->members()) { $_ = $m->url; s/\s/_/g; >>
$(m.fullname)
<< } } >>
Global Variables:
  $(e.fullname)
Global Functions:
  $(e.fullname)
 
<< ## Generate detailed class documentation foreach $c ($p->classes()) { ## Output searchable keyword list if ($c->keywords()) { print "\n"; } >> << # Output main class description >> << # Output author tag if ($c->author()) { >> << } # Output package version if ($c->version()) { >> << } # Output Source file if ($c->sourcefile()) { >> << } # Output "see also" information if ($c->seealso()) { >> << } # Output base class list if ($c->baseclasses()) { >> << } # Output subclasses list if ($c->subclasses()) { >> << } # Output class member variable documentation if ($c->membervars()) { >> << foreach $m ($c->membervars()) { &variable( $m ); } } # Output class member function documentation if ($c->memberfuncs()) { >> << foreach $m ($c->memberfuncs()) { &function( $m ); } } >>
Class: $(c.fullname)
Description $(c.description)
Author $(c.author)
Version $(c.version)
Source File $(c.sourcefile)
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 ); >>
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 ); >>
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 ); >>
Class Variables
Class Functions
 
<< } # Output global variables if ($p->globalvars()) { >> << foreach $m ($p->globalvars()) { &variable( $m ); } >>
Global Variables:
 
<< } # Output global functions if ($p->globalfuncs()) { >> << foreach $m ($p->globalfuncs()) { &function( $m ); } >>
Global Functions:
 
<< } >>
 
Copyright © $copyright. All Rights Reserved.
Generated by ScanDoc $majorVersion.$minorVersion on $date
<< } # 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 ); >>
<< } >>
<< }