Modules | Files | Inheritance Tree | Inheritance Graph | Name Index | Config
module Synopsis::Formatter::HTML::FormatStrategy
class Strategy
Files: Synopsis/Formatter/HTML/FormatStrategy.py
Strategy-inheritance Scopes/Synopsis/Formatter/HTML/FormatStrategy/Heading.html Scopes/Synopsis/Formatter/HTML/FormatStrategy/ClassHierarchySimple.html Scopes/Synopsis/Formatter/HTML/FormatStrategy/BaseAST.html Scopes/Synopsis/Formatter/HTML/FormatStrategy/Default.html

Generates HTML fragment for a declaration. Multiple strategies are combined to generate the output for a single declaration, allowing the user to customise the output by choosing a set of strategies. This follows the Strategy design pattern.

The key concept of this class is the format* methods. Any class derived from Strategy that overrides one of the format methods will have that method called by the Summary and Detail formatters when they visit that AST type. Summary and Detail maintain a list of Strategies, and a list for each AST type.

For example, when Strategy.Summary visits a Function object, it calls the formatFunction method on all Strategys registed with SummaryFormatter that implemented that method. Each of these format methods returns a string, which may contain a TD tag to create a new column.

An important point to note is that only Strategies which override a particular format method are called - if that format method is not overridden then it is not called for that declaration type.


Operations Summary:
 __init__(self, formatter)
Store formatter as self.formatter. [Source]
 formatModifiers(self, modifiers)
Returns a HTML string from the given list of string modifiers. [Source]
 formatDeclaration(self, decl) [Source]
 formatForward(self, decl) [Source]
 formatGroup(self, decl) [Source]
 formatScope(self, decl) [Source]
 formatModule(self, decl) [Source]
 formatMetaModule(self, decl) [Source]
 formatClass(self, decl) [Source]
 formatTypedef(self, decl) [Source]
 formatEnum(self, decl) [Source]
 formatVariable(self, decl) [Source]
 formatConst(self, decl) [Source]
 formatFunction(self, decl) [Source]
 formatOperation(self, decl) [Source]

Operation Details:
  __init__(self, formatter)

Store formatter as self.formatter. The formatter is either a SummaryFormatter or DetailFormatter, and is used for things like reference() and label() calls. Local references to the formatter's reference and label methods are stored in self for more efficient use of them.


  formatModifiers(self, modifiers)

Returns a HTML string from the given list of string modifiers. The modifiers are enclosed in 'keyword' spans.