require 'redcarpet' module ConvertToHtml def self.md_to_html(filename) markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :autolink => true, :space_after_headers => true) markdown.render(File.read(filename)) end def self.init(filename) output = File.open("aipim/relatorio.html", "w") output.puts '' output.puts '' output.puts '
' output.puts ' ' output.puts ' ' output.puts ' ' output.puts ' ' output.puts ' ' output.puts '' output.puts '' output.puts md_to_html(filename) output.puts '' output.puts '' end end ConvertToHtml.init("aipim/markdown.md")