module YARD::Templates::Template

def run(opts = nil, sects = sections, start_at = 0, break_first = false, &block)

Returns:
  • (String) - the rendered sections joined together

Other tags:
    Yieldparam: opts - any extra options to yield

Other tags:
    Yield: - calls for the subsections to be rendered

Parameters:
  • break_first (Boolean) -- if true, renders only the first section
  • start_at (Fixnum) -- the index in the section list to start from
  • sects (Section, Array) -- a section list of sections to render
  • opts (Hash, nil) -- any extra options to apply to sections
def run(opts = nil, sects = sections, start_at = 0, break_first = false, &block)
  out = String.new("")
  return out if sects.nil?
  sects = sects[start_at..-1] if start_at > 0
  sects = Section.new(nil, sects) unless sects.is_a?(Section)
  add_options(opts) do
    sects.each do |s|
      self.section = s
      subsection_index = 0
      value = render_section(section) do |*args|
        value = with_section do
          run(args.first, section, subsection_index, true, &block)
        end
        subsection_index += 1
        value
      end
      out << (value || "")
      break if break_first
    end
  end
  out
end