Skip to content

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

License

Notifications You must be signed in to change notification settings

zeke/textile_helpers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages