class RDoc::Markup::PreProcess

def include_file name, indent, encoding

def include_file name, indent, encoding
  full_name = find_include_file name
  unless full_name then
    warn "Couldn't find file to include '#{name}' from #{@input_file_name}"
    return ''
  end
  content = RDoc::Encoding.read_file full_name, encoding, true
  content = RDoc::Encoding.remove_magic_comment content
  # strip magic comment
  content = content.sub(/\A# .*coding[=:].*$/, '').lstrip
  # strip leading '#'s, but only if all lines start with them
  if content =~ /^[^#]/ then
    content.gsub(/^/, indent)
  else
    content.gsub(/^#?/, indent)
  end
end