Giter Club home page Giter Club logo

textile_helpers's Introduction

Textile Helpers

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

Installation

script/plugin install [email protected]: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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.