RedCloth is a module for using Textile in Ruby. Textile is a text format. A very simple text format. Another stab at making readable text that can be converted to HTML.
Homepage: http://redcloth.org/
User Reference: http://redcloth.org/textile/
API docs: http://redcloth.rubyforge.org/
Development: http://github.com/jgarber/redcloth/
gem install RedCloth
This will install RedCloth 4, the latest version. Make sure you’re typing RedCloth in camel case. gem install redcloth will not work.
The easiest way to test that things are working is to put something like this in one of your views:
<%= RedCloth.new(“h1. This is a test of textile\n\nParagraph\n\nAnother paragraph\n\n* Bullets”).to_html %>
This is a test of textile
Paragraph
Another paragraph
If you’re having problems, check which version you’re running:
$ irb -rubygems > require 'redcloth' => true > RedCloth::VERSION::STRING => "4.0.0"
$ irb -rubygems > require 'redcloth' => true > RedCloth::VERSION => "3.0.4"
If you’re running less than 4, consider upgrading. RedCloth 3.x troubleshooting can be found at RedCloth3
The RedCloth 4 bug tracker is hosted on Lighthouse
Another similar text format is Markdown, created by John Gruber The rails plugin BlueCloth makes it easy to use Markdown in your rails apps.
Basic HTML is considered to be another alternative to textile/markdown markup languages (“Some HTML is OK” as used in Flickr comments).
AnyExample.com has article with simple regexp-based function
ae_some_html that allows usage of small, safe subset of HTML.