[ANN] RedCloth 2.0 -- A Textile Humane Web Text Generator

  • Thread starter why the lucky stiff
  • Start date
W

why the lucky stiff

h1. RedCloth


h2. Humane text for Ruby

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.

Textile is (c) 2003 Dean Allen. All rights reserved. You can read more
"here":http://www.textism.com/tools/textile/.

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

h2. About Version 2.0

Last year, a new version of Textile was released for PHP. This 2.0
version allowed specification of style attributes and element
alignments. Below, is a header element with a green font coloring added.

<pre>
h2{color:green}. This is a title
</pre>

You can also add elements ids, classes, and language settings.

<pre>
h2(class)
h2(#id)
h2[language]
</pre>

RedCloth 2.0 has been completely recoded and tested with Ruby versions
1.8.0 and 1.6.8. There are some outstanding bugs with using RedCloth in
1.6.8, but I'm pushing it out the door anyway. Hopefully, I can get
some further revisions up in the coming weeks.

<http://www.textpattern.com/help/?item=attributes>h2. Installing RedCloth

To install RedCloth via raa-install:

<pre>
raa-install -i redcloth
</pre>

Or "download
RedCloth":http://prdownloads.sourceforge.net/yaml4r/redcloth-2.0.tar.gz
and simply run the install.rb like so:

<pre>
ruby install.rb config
ruby install.rb setup
sudo ruby install.rb install
</pre>


h2. Using RedCloth

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

=> "*strong words* and _emphasized words_"
</pre>

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

=> "<p><strong>strong words</strong> and <em>emphasized words</em></p>"
</pre>


h2. The Textile language

See the "Textile home page":http://www.textism.com/tools/textile/ for
details on the Textile language.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top