Skip to content

Instantly share code, notes, and snippets.

Created September 8, 2011 19:53
What would you like to do?
Render the passed file with GitHub's Markdown renderer
require 'rubygems'
require 'redcarpet'
path = ARGV[0]
file =, 'r')
contents =
markdown_renderer =
html = markdown_renderer.render(contents)
puts html
Copy link

Requires Redcarpet; I installed it with RubyGems.

(Disclaimer: I'm a total Ruby noob.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment