Run at parse time.

        When the documents are initially being scanned, this method runs
        and does two things: (a) creates an instance that is added to
        the site's widgets, and (b) leaves behind a placeholder docutils
        node that can later be processed after the docs are resolved.
        The latter needs enough information to retrieve the former.

def run(self):
        """ Run at parse time.

        When the documents are initially being scanned, this method runs
        and does two things: (a) creates an instance that is added to
        the site's widgets, and (b) leaves behind a placeholder docutils
        node that can later be processed after the docs are resolved.
        The latter needs enough information to retrieve the former.

        """

        this_widget = self.get_widget(self.docname)

        self.widgets[repr(this_widget)] = this_widget

        # Now add the node to the doctree
        widget_node = widget()
        ids = [repr(this_widget)]
        names = [self.name]
        attrs = dict(ids=ids, names=names)
        widget_node.update_basic_atts(attrs)
        return [widget_node]