Method: YARD::Templates::Helpers::HtmlHelper#link_include_file

Defined in:
lib/yard/templates/helpers/html_helper.rb

Include a file as a docstring in output

Parameters:

  • file (String)

    the filename to include

Returns:

  • (String)

    the file’s contents

Since:

  • 0.7.0

[View source]

229
230
231
232
233
234
235
# File 'lib/yard/templates/helpers/html_helper.rb', line 229

def link_include_file(file)
  unless file.is_a?(CodeObjects::ExtraFileObject)
    file = CodeObjects::ExtraFileObject.new(file)
  end
  file.attributes[:markup] ||= markup_for_file('', file.filename)
  htmlify(file.contents, file.attributes[:markup] || options[:markup])
end