'Process the docinfo part of the doctree as metadata.'

def process_metadata(self, docname, doctree):

    self.metadata[docname] = md = {}
    try:
        docinfo = doctree[0]
    except IndexError:
        return
    if (docinfo.__class__ is not nodes.docinfo):
        return
    for node in docinfo:
        if (node.__class__ is nodes.author):
            md['author'] = node.astext()
        elif (node.__class__ is nodes.field):
            (name, body) = node
            md[name.astext()] = body.astext()
    del doctree[0]
