Examples:
Simple
Custom buttons
Buttons manipulation
Custom settings
Custom functions

mark_it_up

Custom functions example

Code used

show layout code

  
  <%
  
    MarkItUp.buttons = MarkItUp.default_buttons
  
    MarkItUp.insert_button({ :name => 'Some button', :icon => 'code', :call => 'MyNamespace.someFunction' })
  
    MarkItUp.insert_button({ :name => 'Some other button', :icon => 'clean', :call => 'MyNamespace.someOtherFunction' })
  
  %>
  
  
  
  <% content_for :head do %>
  
    <script type="text/javascript">
  
      MyNamespace = {
  
        someFunction: function() {
  
          jQuery.markItUp({ target: '#miu_test', replaceWith: 'text from some function' });
  
        },
  
        someOtherFunction: function() {
  
          jQuery.markItUp({ target: '#miu_test', replaceWith: 'text from some other function' });
  
        }
  
      }
  
    </script>
  
    <%= mark_it_up '#miu_test' %>
  
  <% end %>
  
  
  
  <% form_tag do %>
  
    <%= text_area_tag "miu_test" %>
  
  <% end %>
  

For more info see http://github.com/cingel/mark_it_up