Created
December 28, 2009 14:20
-
-
Save chikamichi/264691 to your computer and use it in GitHub Desktop.
rackcodehighlighter, ultraviolet and maruku
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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