Base class for formatting a Part of a Scope View.
This class contains functionality for modularly formatting an ASG node and
its children for display. It is typically used to construct Heading,
Summary and Detail formatters. Strategy objects are added according to
configuration, and this base class then checks which format methods each
strategy implements. For each ASG declaration visited, the Part asks all
Strategies which implement the appropriate format method to generate
output for that declaration. The final writing of the formatted html is
delegated to the write_section_start, write_section_end, and write_section_item
methods, which must be implemented in a subclass.
Methods Details:
reference(
self,
name,
label =
None,
* * keys)
Returns a reference to the given name. The name is a scoped name,
and the optional label is an alternative name to use as the link text.
The name is looked up in the TOC so the link may not be local. The
optional keys are appended as attributes to the A tag.
label(
self,
name,
label =
None)
Create a label for the given name. The label is an anchor so it can
be referenced by other links. The name of the label is derived by
looking up the name in the TOC and using the link in the TOC entry.
The optional label is an alternative name to use as the displayed
name. If the name is not found in the TOC then the name is not
anchored and just label is returned (or name if no label is given).
Format decl using named method of each fragment. Each fragment
returns two strings - type and name. All the types are joined and all
the names are joined separately. The consolidated type and name
strings are then passed to write_section_item.
Formats the given decl, creating the output for this Part of the
view. This method is implemented in various subclasses in different
ways, for example Summary and Detail iterate through the children of
'decl' section by section, whereas Heading only formats decl itself.
Returns a reference string for the given type object
Sets the label to be a reference to the type's name
Sets the label to be a reference to the type's link
Sets the label to be a reference to the type's name
Sets the label to be the type's name (which has no proper scope)
Adds modifiers to the formatted label of the modifier's alias
Adds the parameters to the template name in angle brackets
Labs the template with the parameters
Labels the function type with return type, name and parameters
Abstract method to start the output, eg table headings
Abstract method to start a section of declaration types
Abstract method to end a section of declaration types
Abstract method to write the output of one formatted declaration
Abstract method to end the output, eg close the table