Main entrypoint method.

        Returns
        -------
        new_nodes : `list`
            Nodes to add to the doctree.

def run(self):
        """Main entrypoint method.

        Returns
        -------
        new_nodes : `list`
            Nodes to add to the doctree.
        """
        logger = getLogger(__name__)

        try:
            task_class_name = self.arguments[0]
        except IndexError:
            raise SphinxError(
                '{} directive requires a Task class name as an '
                'argument'.format(self.directive_name))
        logger.debug('%s using Task class %s', self.directive_name,
                     task_class_name)

        task_config_class = get_task_config_class(task_class_name)
        subtask_fields = get_subtask_fields(task_config_class)

        all_nodes = []
        for field_name, field in subtask_fields.items():
            field_id = format_configfield_id(
                '.'.join((task_config_class.__module__,
                          task_config_class.__name__)),
                field_name)
            try:
                format_field_nodes = get_field_formatter(field)
            except ValueError:
                logger.debug('Skipping unknown config field type, '
                             '{0!r}'.format(field))
                continue

            all_nodes.append(
                format_field_nodes(field_name, field, field_id, self.state,
                                   self.lineno)
            )

        # Fallback if no configuration items are present
        if len(all_nodes) == 0:
            message = 'No subtasks.'
            return [nodes.paragraph(text=message)]

        return all_nodes