public
Description: This Rails plugin provides some view helpers that enhance Textile support.
Homepage:
Clone URL: git://github.com/zeke/textile_helpers.git
name age message
file MIT-LICENSE Fri Apr 10 12:34:03 -0700 2009 first commit [zeke]
file README.rdoc Sun Nov 08 12:12:10 -0800 2009 Cleaned up the README a bit [zeke]
file Rakefile Fri Apr 10 12:34:03 -0700 2009 first commit [zeke]
file init.rb Fri Apr 10 12:34:03 -0700 2009 first commit [zeke]
file install.rb Fri Apr 10 12:34:03 -0700 2009 first commit [zeke]
directory lib/ Sun Nov 08 12:05:53 -0800 2009 Added a method to protect 501(c)(3)-ish strings... [zeke]
directory spec/ Sun Nov 08 12:05:53 -0800 2009 Added a method to protect 501(c)(3)-ish strings... [zeke]
directory tasks/ Fri Apr 10 12:34:03 -0700 2009 first commit [zeke]
directory test/ Fri Apr 10 12:34:03 -0700 2009 first commit [zeke]
file uninstall.rb Fri Apr 10 12:34:03 -0700 2009 first commit [zeke]
README.rdoc

Textile Helpers

This Rails plugin provides some view helpers that enhance Textile support.

Installation

  script/plugin install git@github.com:zeke/textile_helpers.git

As of Rails 2.3, You may also need to install the RedCloth gem..

  sudo gem install redcloth

..and add this to environment.rb

  config.gem "RedCloth"

Overview and Usage

The textilize_plus helper method works just like Rails’ textilize method, but with a few goodies added. It cleans up MS Word characters; repairs (some) faulty markup, such as heading tags (h1, h2, etc) not having a newline underneath them; adds an id attribute to headings based on the content of the heading.

  textilize_plus(my_string)

The table_of_contents_for helper method is meant to be paired with textilize_plus. It parses your textilizable string and generate a hierarchical table of countents based on the h1, h2, and h3 headings.

  <div id="main">
    <%= textilize_plus(my_string) %>
  </div>

  <div id="sidebar">
    <%= table_of_contents_for(my_string) %>
  </div>

See lib/textile_helpers.rb for more details.

License

Copyright © 2009 Zeke Sikelianos, released under the MIT license