Modules | Files | Inheritance Tree | Inheritance Graph | Name Index | Config
module Synopsis::Formatter::HTML::Page
class Page
Files: Synopsis/Formatter/HTML/Page.py
Page-inheritance Scopes/Synopsis/Formatter/HTML/Page/BufferPage.html

Base class for a Page. The base class provides a common interface, and also handles common operations such as opening the file, and delegating the page formatting to a strategy class.

See Also:
PageFormat


Operations Summary:
 __init__(self, manager)
Constructor, loads the formatting class. [Source]
 filename(self)
Polymorphic method returning the filename associated with the page [Source]
 title(self)
Polymorphic method returning the title associated with the page [Source]
 os(self)
Returns the output stream opened with start_file [Source]
 write(self, str)
Writes the given string to the currently opened file [Source]
 register(self)
Registers this Page class with the PageManager. [Source]
 register_filenames(self, start)
Registers filenames for each file this Page will generate, given the starting Scope. [Source]
 get_toc(self, start)
Retrieves the TOC for this page. [Source]
 process(self, start)
Process the given Scope recursively. [Source]
 process_scope(self, scope)
Process just the given scope [Source]
 open_file(self)
Returns a new output stream. [Source]
 close_file(self)
Closes the internal output stream. [Source]
 start_file(self, body = '', headextra = '')
Start a new file with given filename, title and body. [Source]
 end_file(self, body = '')
Close the file using given close body tag. [Source]
 reference(self, name, scope, label = None, **keys)
Returns a reference to the given name. [Source]

Operation Details:
  __init__(self, manager)

Constructor, loads the formatting class.

See Also:
PageFormat


  register(self)

Registers this Page class with the PageManager. This method is abstract - derived Pages should implement it to call the appropriate methods in PageManager if they need to. This method is called after construction.


  get_toc(self, start)

Retrieves the TOC for this page. This method assumes that the page generates info for the the whole AST, which could be the ScopePages, the FilePages (source code) or the XRefPages (cross reference info). The default implementation returns None. Start is the declaration to start processing from, which could be the global namespace.


  process(self, start)

Process the given Scope recursively. This is the method which is called to actually create the files, so you probably want to override it ;)


  open_file(self)

Returns a new output stream. This template method is for internal use only, but may be overriden in derived classes. The default joins config.basename and self.filename() and uses Util.open()


  close_file(self)

Closes the internal output stream. This template method is for internal use only, but may be overriden in derived classes.


  start_file(self, body = '', headextra = '')

Start a new file with given filename, title and body. This method opens a file for writing, and writes the html header crap at the top. You must specify a title, which is prepended with the project name. The body argument is optional, and it is preferred to use stylesheets for that sort of stuff. You may want to put an onLoad handler in it though in which case that's the place to do it. The opened file is stored and can be accessed using the os() method.


  end_file(self, body = '')

Close the file using given close body tag. The default is just a close body tag, but if you specify '' then nothing will be written (useful for a frames page)


  reference(self, name, scope, 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.