class Mdpresent::HomePageGenerator

Public Instance Methods

generate() click to toggle source
# File lib/mdpresent/home_page_generator.rb, line 6
def generate
  puts "Generating home page..."
  # file with template variables
  home_page_input = File.read('index.erubis')

  # create eruby object
  home_page_eruby = Erubis::Eruby.new(home_page_input)

  link_desc_map = get_link_description_map

  # generate home.html page
  File.write('index.html', home_page_eruby.result(:link_desc => link_desc_map))
end
get_custom_description() click to toggle source
# File lib/mdpresent/home_page_generator.rb, line 43
def get_custom_description
  if File.exists?('mdpfile')
    config = ParseConfig.new('mdpfile')
    return config.params
  else
    return {}
  end
end