'Include a reST file as part of the content of this reST file.'

def run(self):

    if (not self.state.document.settings.file_insertion_enabled):
        raise self.warning(('"%s"    directive    disabled.' % self.name))
    source = self.state_machine.input_lines.source(((self.lineno - self.state_machine.input_offset) - 1))
    source_dir = os.path.dirname(os.path.abspath(source))
    path = directives.path(self.arguments[0])
    if (path.startswith('<') and path.endswith('>')):
        path = os.path.join(self.standard_include_path, path[1:(-1)])
    path = os.path.normpath(os.path.join(source_dir, path))
    path = utils.relative_path(None, path)
    encoding = self.options.get('encoding', self.state.document.settings.input_encoding)
    try:
        self.state.document.settings.record_dependencies.add(path)
        include_file = io.FileInput(source_path=path, encoding=encoding, error_handler=self.state.document.settings.input_encoding_error_handler, handle_io_errors=None)
    except IOError as error:
        raise self.severe(('Problems    with    "%s"    directive    path:\n%s:    %s.' % (self.name, error.__class__.__name__, error)))
    try:
        include_text = include_file.read()
    except UnicodeError as error:
        raise self.severe(('Problem    with    "%s"    directive:\n%s:    %s' % (self.name, error.__class__.__name__, error)))
    after_text = self.options.get('start-after', None)
    if after_text:
        after_index = include_text.find(after_text)
        if (after_index < 0):
            raise self.severe(('Problem    with    "start-after"    option    of    "%s"    directive:\nText    not    found.' % self.name))
        include_text = include_text[(after_index + len(after_text)):]
    before_text = self.options.get('end-before', None)
    if before_text:
        before_index = include_text.find(before_text)
        if (before_index < 0):
            raise self.severe(('Problem    with    "end-before"    option    of    "%s"    directive:\nText    not    found.' % self.name))
        include_text = include_text[:before_index]
    if self.options.has_key('literal'):
        literal_block = nodes.literal_block(include_text, include_text, source=path)
        literal_block.line = 1
        return [literal_block]
    else:
        include_lines = statemachine.string2lines(include_text, convert_whitespace=1)
        self.state_machine.insert_input(include_lines, path)
        return []
