class Verku::Exporter::HTML

Public Instance Methods

export!() click to toggle source
# File lib/verku/exporter/html.rb, line 5
def export!
  locals = config.merge({ "contents" => content })
  locals['copyright'].gsub!("(C)", "©")
  output = render_template(root_dir.join("_templates/html/layout.erb"), locals)
  File.open(root_dir.join(html_file), 'w').write(output)
  true

rescue Exception => error
  handle_error(error)
  false
end

Private Instance Methods

content() click to toggle source
# File lib/verku/exporter/html.rb, line 18
def content
  source_list.map do |file|
    Kramdown::Document.new(
      read_content(file)[0]
    ).to_html
  end.join("\n\n")
end