HTMLFormatter

An HTML Formatter formats TextBlock objects into HTML.

Base Classes

Methods

__init__(self, out)

   def __init__(self, out):

Constructs an HTML formatted from an output stream.

_commit(self, data)

   def _commit(self, data):

Provides mandatory override of spug.nml.StdFormatter.StdFormatter._commit(), writing the data to the output file.

_fix(self, val)

   def _fix(self, val):

Converts '>', '<' and '&' to HTML escape sequences.

_getTags(self, type)

   def _getTags(self, type):

Returns a tuple of the leading and trailing tags for the given type.

_writeWords(self, words)

   def _writeWords(self, words):

Writes a list of words and subblocks.

format(self, block)

   def format(self, block):

Formats the block as its HTML equivalent.

formatAll(self, text)

   def formatAll(self, text):

Formats text (an NML TextBlock) as a complete HTML document.