Method: Betterdocs::Generator::Markdown#create_sections

Defined in:
lib/betterdocs/generator/markdown.rb

#create_sections(dirname) ⇒ Object



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/betterdocs/generator/markdown.rb', line 45

def create_sections(dirname)
  Infobar(total: sections.size)
  cd dirname do
    for section in sections.values
      infobar.progress(
        message: " Section #{section.name.to_s.inspect} %c/%t in %te ETA %e @%E ",
        force:   true
      )
      if @only
        @only =~ section.name or next
      end
      render_to "sections/#{section.name}.md", section_template, section.instance_eval('binding')
    end
  end
  infobar.finish message: ' %t sections created in %te, completed @%E '
  infobar.newline
  self
end