Skip to content
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


p=. !redcloth-title.png!

<div style="font-family: verdana, arial, sans-serif; font-size: 10pt; border-left: solid 1px #999; width: 200px; float: right;">

*Get RedCloth*

p(example1). *Latest version:* "2.0.7":

Take a complete tour of Textile at "A Textile Reference":

For fast syntax checking, try the "Quick Reference":

p(example1). Upgrade with RubyGems!  Try: 
@gem -Ri RedCloth@.

*RedCloth Links*

"Instiki": is the greatest Wiki ever!  Uses RedCloth for its markup!

"Hobix": is a lovely little blogging package which uses RedCloth for
blog entries.


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.

h2. What is Textile?

Textile is a simple markup language.

|_. textile |_. to |_. html |
| ==_a phrase_== | -> | _a phrase_ |
| ==*a phrase*== | -> | *a phrase* |
| ==_*a phrase*_== | -> | _*a phrase*_ |
| =="Google": | -> | "Google": |

No need to use verbose HTML to build your docs, your blogs, your pages.  Textile gives you readable text while you're writing and beautiful text for your readers.  And if you need to break out into HTML, Textile will allow you to do so.

Textile also handles some subtleties of formatting which will enhance your document's readability:

* Single- and double-quotes around words or phrases are converted to curly quotations, much easier on
  the eye.  "Observe!"

* Double hyphens are replaced with an em-dash.  Observe -- very nice!

* Single hypens are replaced with en-dashes. Observe - so cute!

* Triplets of periods become an ellipsis.  Observe...

* The letter 'x' becomes a dimension sign when used alone.  Observe: 2 x 2.

* Conversion of ==(TM)== to (TM), ==(R)== to (R), ==(C)== to (C).

For more on Textile's language, hop over to "A Textile Reference":

h2. Using RedCloth

The RedCloth class is an extension of Ruby's String class. Use it like you would a String:

  >> r = "*strong text* and _emphasized text_"
  => "*strong text* and _emphasized text_"
  >> r.gsub!( 'text', 'words' )
  => "*strong words* and _emphasized words_"

To generate HTML from your RedCloth object, use the @RedCloth#to_html@ method:

  >> r.to_html
  => "<p><strong>strong words</strong> and <em>emphasized words</em></p>"

h2. Installing RedCloth

To install RedCloth via RubyGems:

  gem -Ri RedCloth

Or "download RedCloth": and simply run the install.rb like so:

  ruby install.rb config
  ruby install.rb setup
  sudo ruby install.rb install

h2. Acknowledgements

Textile is (c) 2003 Dean Allen.  All rights reserved. You can read more "here":

RedCloth is also based on PyTextile, which is: Copyright (c) 2003, "Mark Pilgrim":  All rights reserved.  You can read more about PyTextile "here":

Something went wrong with that request. Please try again.