class RDoc::Generator::Darkfish

def template_for file, page = true, klass = ERB

def template_for file, page = true, klass = ERB
  template = @template_cache[file]
  return template if template
  if page then
    template = assemble_template file
    erbout = 'io'
  else
    template = file.read
    template = template.encode @options.encoding
    file_var = File.basename(file).sub(/\..*/, '')
    erbout = "_erbout_#{file_var}"
  end
  if RUBY_VERSION >= '2.6'
    template = klass.new template, trim_mode: '<>', eoutvar: erbout
  else
    template = klass.new template, nil, '<>', erbout
  end
  @template_cache[file] = template
  template
end