Skip to content

Instantly share code, notes, and snippets.

@reggieb
Created February 8, 2013 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reggieb/4739976 to your computer and use it in GitHub Desktop.
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
Copy link
Author

reggieb commented Feb 8, 2013

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