# File lib/asciidoctor/reader.rb, line 1048
  def push_include data, file = nil, path = nil, lineno = 1, attributes = {}
    @include_stack << [@lines, @file, @dir, @path, @lineno, @maxdepth, @process_lines]
    if file
      @file = file
      @dir = File.dirname file
      # only process lines in AsciiDoc files
      @process_lines = ASCIIDOC_EXTENSIONS[::File.extname file]
    else
      @file = nil
      @dir = '.' # right?
      # we don't know what file type we have, so assume AsciiDoc
      @process_lines = true
    end

    if path
      @includes << Helpers.rootname(@path = path)
    else
      @path = '<stdin>'
    end

    @lineno = lineno

    if attributes.key? 'depth'
      depth = attributes['depth'].to_i
      depth = 1 if depth <= 0
      @maxdepth = {:abs => (@include_stack.size - 1) + depth, :rel => depth}
    end

    # effectively fill the buffer
    if (@lines = prepare_lines data, :normalize => true, :condense => false, :indent => attributes['indent']).empty?
      pop_include
    else
      # FIXME we eventually want to handle leveloffset without affecting the lines
      if attributes.key? 'leveloffset'
        @lines.unshift ''
        @lines.unshift %(:leveloffset: #{attributes['leveloffset']})
        @lines << ''
        if (old_leveloffset = @document.attr 'leveloffset')
          @lines << %(:leveloffset: #{old_leveloffset})
        else
          @lines << ':leveloffset!:'
        end
        # compensate for these extra lines
        @lineno -= 2
      end

      # FIXME kind of a hack
      #Document::AttributeEntry.new('infile', @file).save_to_next_block @document
      #Document::AttributeEntry.new('indir', @dir).save_to_next_block @document
      @look_ahead = 0
    end
    self
  end