Translates a parsed Barrister IDL into HTML.  Returns a string containing the HTML.

    :Parameters:
      title
        Title of the document. Will be included in <title> and <h1> tags
      idl_parsed
        Parsed representation of IDL to convert to HTML

def docco_html(title, idl_parsed, diagram_fname=None):
    """
    Translates a parsed Barrister IDL into HTML.  Returns a string containing the HTML.

    :Parameters:
      title
        Title of the document. Will be included in <title> and <h1> tags
      idl_parsed
        Parsed representation of IDL to convert to HTML
    """
    sections = to_sections(idl_parsed)
    s = """<!DOCTYPE html>
<html>
<head>
  <title>%s</title>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <style type="text/css">
  %s
  </style>
</head>
<body>
  <div id="container">
    <div id="background"></div>
    <table cellpadding="0" cellspacing="0">
      <thead>
        <tr>
          <th class="docs">
            <h1>
               %s
            </h1>
          </th>
          <th class="code">
          </th>
        </tr>
      </thead>
      <tbody>""" % (title, DOCCO_CSS, title)
    
    i = 0
    for sec in sections:
        i += 1
        s += """<tr id="section-%d">
            <td class="docs">
              <div class="pilwrap">
                <a class="pilcrow" href="#section-%d">&#182;</a>
              </div>
              %s
            </td>
            <td class="code">
              %s
            </td>
          </tr>""" % (i, i, sec['docs'], sec['code'])

    s += """</tbody>
    </table>
  </div>
</body>
</html>"""
    if diagram_fname:
        diagram_link = """<a href="%s"><img src="%s" height="120" width="120" border="0" /></a>""" % (diagram_fname, diagram_fname)
        s = s.replace("[[diagram]]", diagram_link)
    return s