Skip to content

Instantly share code, notes, and snippets.

@chikamichi
Created December 28, 2009 14:20
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 chikamichi/264691 to your computer and use it in GitHub Desktop.
Save chikamichi/264691 to your computer and use it in GitHub Desktop.
rackcodehighlighter, ultraviolet and maruku
actually it's views/hello.md, but gist would trigger Markdown highlighting
# Fibonacci numbers in Ruby
:::ruby
def fib(n)
if n < 2
1
else
fib(n-2) + fib(n-1)
end
end
require 'rubygems'
require 'haml'
require 'sinatra'
require 'uv'
require 'rack/codehighlighter'
require 'maruku'
use Rack::Codehighlighter, :ultraviolet, :markdown => true, :theme => "dawn", :lines => false, :element => "pre>code", :pattern => /\A:::(\w+)\s*\n/, :logging => false
get "/" do
text = File.open("views/hello.md").read
Maruku.new(text).to_html
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment