Class: Lono::Markdown::Index

Inherits:
Object
  • Object
show all
Defined in:
lib/lono/markdown/index.rb

Instance Method Summary collapse

Constructor Details

#initialize(command_class) ⇒ Index

Returns a new instance of Index.



3
4
5
# File 'lib/lono/markdown/index.rb', line 3

def initialize(command_class)
  @command_class = command_class
end

Instance Method Details

#command_listObject



11
12
13
14
15
16
17
18
# File 'lib/lono/markdown/index.rb', line 11

def command_list
  @command_class.commands.keys.sort.map.each do |command_name|
    page = Page.new(@command_class, command_name)
    link = page.path.sub("docs/", "")
    # Example: [lono cfn]({% link _reference/lono-cfn.md %})
    "* [lono #{command_name}]({% link #{link} %})"
  end.join("\n")
end

#docObject



26
27
28
29
30
31
32
33
34
# File 'lib/lono/markdown/index.rb', line 26

def doc
  <<-EOL
---
title: CLI Reference
---
#{summary}
#{command_list}
EOL
end

#pathObject



7
8
9
# File 'lib/lono/markdown/index.rb', line 7

def path
  "docs/reference.md"
end

#summaryObject



20
21
22
23
24
# File 'lib/lono/markdown/index.rb', line 20

def summary
  <<-EOL
Lono is a CloudFormation framework tool that helps you manage your templates. Lono handles the entire CloudFormation lifecycle. It starts with helping you develop your templates and helps you all the way to the infrastructure provisioning step.
EOL
end