A MarkDown TextEditor with jQuery and Markitup! and redcarpet for Rails 3

use: Markitup and Redcarpet

Demo

Support Env:

Rails3.0.8+/Ruby1.8.7+

Usage:

you need install pygments

easy_install pygments
  1. In Gemfile:

    gem "redcarpet" gem "albino" gem "nokogiri" gem 'rails_markitup'

  2. Then run :

    rails g rails_markitup:install

  3. In layout:

    stylesheet_link_tag :markitup

    javascript_include_tag :markitup

    or you can use another highlight css:

    stylesheet_link_tag :markitup_shiny

  4. In your textarea , simple_form_for exapmle:

    form.input :content, :as => :text, :input_html => => 'markdown'

  5. In your application.js:

    $(document).ready(function(){ $('#markdown').markItUp(myMarkdownSettings); });

  6. In your show page:

    markdown(@topic.content)

    if you use shiny style

    markdown(@topic.content, 'shiny')