Module: PuppetStrings::Markdown::TableOfContents

Defined in:
lib/puppet-strings/markdown/table_of_contents.rb

Class Method Summary collapse

Class Method Details

.renderObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/puppet-strings/markdown/table_of_contents.rb', line 5

def self.render
  final = "## Table of Contents\n\n"

  [PuppetStrings::Markdown::PuppetClasses,
  PuppetStrings::Markdown::DefinedTypes,
  PuppetStrings::Markdown::ResourceTypes,
  PuppetStrings::Markdown::Functions,
  PuppetStrings::Markdown::DataTypes,
  PuppetStrings::Markdown::PuppetTasks,
  PuppetStrings::Markdown::PuppetPlans].each do |r|
    toc = r.toc_info
    group_name = toc.shift
    group = toc
    priv = r.contains_private?

    template = File.join(File.dirname(__FILE__),"templates/table_of_contents.erb")
    final += ERB.new(File.read(template), nil, '-').result(binding)
  end
  final
end