Skip to content

Instantly share code, notes, and snippets.

@jasonm23
Created July 23, 2010 00:39
Show Gist options
  • Save jasonm23/486850 to your computer and use it in GitHub Desktop.
Save jasonm23/486850 to your computer and use it in GitHub Desktop.
How to do markdown/textile views via erubis in Sinatra.

How to do markdown/textile views via erubis in Sinatra.

require 'bluecloth' # could do the same with RDiscount or Maruku or RedCloth (using Textile instead) or ... whatever.

get '/' do
    BlueCloth.new(erubis :index).to_html
end

and your views/index.erubis would be something like...

# Headline <%= puts "do some ruby..." %>

lorem ipsum blah blah blah...

* list 
* list 

 Some more markdown...

To give you...

Headline do some ruby...

lorem ipsum blah blah blah...

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