Skip to content

Instantly share code, notes, and snippets.

@reggieb
Created February 8, 2013 16:06
Show Gist options
  • Select an option

  • Save reggieb/4739976 to your computer and use it in GitHub Desktop.

Select an option

Save reggieb/4739976 to your computer and use it in GitHub Desktop.
I'm getting tired of not being quite sure how my README.rdoc will appear when loaded onto github. By adding this to the root of my app, I can 'ruby display_readme.rb' to see the rendered README.rdoc at localhost:4567
require 'sinatra'
require 'rdoc/markup/to_html'
get '/' do
input_string = ""
parser = RDoc::Markup::ToHtml.new
File.open("README.rdoc", "r") do |file|
file.each_line{|l| input_string << l}
end
parser.convert(input_string)
end
@reggieb

reggieb commented Feb 8, 2013

Copy link
Copy Markdown
Author

Oh: you also have to add this to your gemfile:

group :development do
  gem 'sinatra'
end

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