'Constructs the docutils content for the summary of
the support matrix.
The summary consists of a giant table, with one row
for each feature, and a column for each backend
driver. It provides an \'at a glance\' summary of the
status of each driver'

def _build_summary(self, matrix, content):

    summary_title = nodes.subtitle(text='Summary')
    summary = nodes.table()
    cols = len(matrix.targets.keys())
    cols += 2
    summary_group = nodes.tgroup(cols=cols)
    summary_body = nodes.tbody()
    summary_head = nodes.thead()
    for i in range(cols):
        summary_group.append(nodes.colspec(colwidth=1))
    summary_group.append(summary_head)
    summary_group.append(summary_body)
    summary.append(summary_group)
    content.append(summary_title)
    content.append(summary)
    header = nodes.row()
    blank = nodes.entry()
    blank.append(nodes.emphasis(text='Feature'))
    header.append(blank)
    blank = nodes.entry()
    blank.append(nodes.emphasis(text='Status'))
    header.append(blank)
    summary_head.append(header)
    impls = matrix.targets.keys()
    impls.sort()
    for key in impls:
        target = matrix.targets[key]
        implcol = nodes.entry()
        header.append(implcol)
        if target.link:
            uri = target.link
            target_ref = nodes.reference('', refuri=uri)
            target_txt = nodes.inline()
            implcol.append(target_txt)
            target_txt.append(target_ref)
            target_ref.append(nodes.strong(text=target.title))
        else:
            implcol.append(nodes.strong(text=target.title))
    for feature in matrix.features:
        item = nodes.row()
        feature_id = re.sub(RE_PATTERN, '_', feature.key)
        key_col = nodes.entry()
        item.append(key_col)
        key_ref = nodes.reference(refid=feature_id)
        key_txt = nodes.inline()
        key_col.append(key_txt)
        key_txt.append(key_ref)
        key_ref.append(nodes.strong(text=feature.title))
        status_col = nodes.entry()
        item.append(status_col)
        status_col.append(nodes.inline(text=feature.status, classes=[('sp_feature_' + feature.status)]))
        impls = matrix.targets.keys()
        impls.sort()
        for key in impls:
            target = matrix.targets[key]
            impl = feature.implementations[key]
            impl_col = nodes.entry()
            item.append(impl_col)
            key_id = re.sub(RE_PATTERN, '_', '{}_{}'.format(feature.key, key))
            impl_ref = nodes.reference(refid=key_id)
            impl_txt = nodes.inline()
            impl_col.append(impl_txt)
            impl_txt.append(impl_ref)
            status = STATUS_DICT.get(impl.status, '')
            impl_ref.append(nodes.literal(text=status, classes=['sp_impl_summary', ('sp_impl_' + impl.status)]))
        summary_body.append(item)
