rubocop: enable AbcSize
 Convert the document using the converters which match this renderer's document.

 Returns String the converted content.
179045
def convert(content)
      converters.reduce(content) do |output, converter|
        begin
          converter.convert output
        rescue StandardError => e
          Jekyll.logger.error "Conversion error:",
                              "#{converter.class} encountered an error while "\
                              "converting '#{document.relative_path}':"
          Jekyll.logger.error("", e.to_s)
          raise e
        end
      end
    end
682530
def get_rendition_size(self, spec, output_scale, crop):
        

        if crop:
            # Use the cropping rectangle size
            _, _, width, height = crop
        else:
            # Use the original image size
            width = self._record.width
            height = self._record.height

        mode = spec.get('resize', 'fit')
        if mode == 'fit':
            return self.get_rendition_fit_size(spec, width, height, output_scale)

        if mode == 'fill':
            return self.get_rendition_fill_size(spec, width, height, output_scale)

        if mode == 'stretch':
            return self.get_rendition_stretch_size(spec, width, height, output_scale)

        raise ValueError("Unknown resize mode {}".format(mode))
631592
def to_s(attributes=nil)
      content = printable_content(attributes)
      content_s = content.pp_s(:single_line) unless content.empty?
      "#{print_class_and_id}#{content_s}"
    end
140719
def to_s
      ptr = CF.CFDataGetBytePtr(self)
      if CF::String::HAS_ENCODING
        ptr.read_string(CF.CFDataGetLength(self)).force_encoding(Encoding::ASCII_8BIT)
      else
        ptr.read_string(CF.CFDataGetLength(self))
      end
    end
190219
def to_commonmark(options = :DEFAULT, width = 120)
      opts = Config.process_options(options, :render)
      _render_commonmark(opts, width).force_encoding('utf-8')
    end
633932
def Size(self):
        
        return s.uint8 + s.uint8 + GetVarSize(self.Attributes) + GetVarSize(self.inputs) + GetVarSize(self.outputs) + GetVarSize(self.Scripts)
820591
def to_s
      buf = ["Document {"]
      self.keys.sort_by {|key| key.to_s}.each do |key|
        val = self[key]
        val_str = if val.instance_of? Array then %{["#{val.join('", "')}"]}
                  elsif val.is_a? Field then val.to_s
                  else %{"#{val.to_s}"}
                  end
        buf << "  :#{key} => #{val_str}"
      end
      buf << ["}#{@boost == 1.0 ? "" : "^" + @boost.to_s}"]
      return buf.join("\n")
    end
355219
def to_plaintext(options = :DEFAULT, width = 120)
      opts = Config.process_options(options, :render)
      _render_plaintext(opts, width).force_encoding('utf-8')
    end
1096306
def textilize(input)
      site = @context.registers[:site]
      converter = if site.respond_to?(:find_converter_instance)
        site.find_converter_instance(Jekyll::Converters::Textile)
      else
        site.getConverterImpl(Jekyll::Converters::Textile)
      end
      converter.convert(input)
    end
443400
def load!
      text = source||""
      @cached_stuff ||= 
      begin
        if options[:cache_to] # Getting recorded hash dump
          Marshal.load(Base64.decode64(@env.send(options[:cache_to]))).tap do |cached_stuff|
            if cached_stuff.time < Date.new(2012,7,25)
              #### CACHE OUT OF DATE ####
              warn "WARNING: html_slicer's cached stuff for #{@env.class.name} records has become unacceptable because of code changes. Update each record again. Visit http://vkvon.ru/projects/html_slicer for further details."
              raise Exception 
            end
          end
        else
          raise Exception
        end
      rescue Exception, TypeError, NoMethodError # New cache object otherwise
        CachedStuff.new
      end
      if @document.blank? || !@cached_stuff.valid_text?(text) # Initialize new @document if not exist or content has been changed
        @document = ::HTML::Document.new(text)
        @cached_stuff.hexdigest_for = text
      end
      if @cached_stuff.changed? || !@cached_stuff.valid_resizing_options?(@resizing_options) # Initialize new resizing process if the content or options has been changed
        if @resizing_options
          @cached_stuff.resizing = Resizing.new(@document, @resizing_options)
        else
          @cached_stuff.resizing = nil
        end
      end
      if @cached_stuff.changed? || !@cached_stuff.valid_slicing_options?(@slicing_options) # Initialize new slicing process if the content or options has been changed
        if @slicing_options
          @cached_stuff.slicing = Slicing.new(@document, @slicing_options)
        else
          @cached_stuff.slicing = nil
        end
      end
      if @cached_stuff.changed? # Serialize and dump the cache if any changes provided
        @cached_stuff.changed = false
        if options[:cache_to]
          @env.send("#{options[:cache_to]}=", @cached_stuff.to_dump)
        end
      end
    end
1106253
def get_file_size(filename):
    
    if os.path.isfile(filename):
        return convert_size(os.path.getsize(filename))
    return None
858495
def convert_node(self, node):
        
        convert = getattr(self, 'convert_' + striptag(node.tag))
        return convert(node)
197021
def resizeToContents(self):
        
        doc = self.document()
        h = doc.documentLayout().documentSize().height()
        self.setFixedHeight(h + 4)
767282
def to_h
      @size_dep.depend

      if @attributes.nil?
        nil
      else
        hash = {}
        @attributes.each_pair do |key, value|
          hash[key] = deep_unwrap(value)
        end
        hash
      end
    end
1081093
def size_to_content(self):
        
        new_sizing = self.copy_sizing()
        new_sizing.minimum_height = 0
        new_sizing.maximum_height = 0
        axes = self.__axes
        if axes and axes.is_valid:
            if axes.x_calibration and axes.x_calibration.units:
                new_sizing.minimum_height = self.font_size + 4
                new_sizing.maximum_height = self.font_size + 4
        self.update_sizing(new_sizing)
199478
def sassify(input)
      site = @context.registers[:site]
      converter = site.find_converter_instance(Bunto::Converters::Sass)
      converter.convert(input)
    end
488573
def to_s
      max_size = CF.CFStringGetMaximumSizeForEncoding(length, UTF8)
      range = CF::Range.new
      range[:location] = 0
      range[:length] = length
      buffer = FFI::MemoryPointer.new(:char, max_size)

      cfindex = CF.find_type(:cfindex)
      bytes_used_buffer = FFI::MemoryPointer.new(cfindex)

      CF.CFStringGetBytes(self, range, UTF8, 0, 0, buffer, max_size, bytes_used_buffer)

      bytes_used = if cfindex == CF.find_type(:long_long)
        bytes_used_buffer.read_long_long
      else
        bytes_used_buffer.read_long
      end

      if HAS_ENCODING
        buffer.read_string(bytes_used).force_encoding(Encoding::UTF_8)
      else
        buffer.read_string(bytes_used)
      end
    end