# How to beat minimal wiki features out of redcloth?

**URL:** <https://www.ruby-forum.com/t/how-to-beat-minimal-wiki-features-out-of-redcloth/164772>\
**Category:** Ruby\
**Created:** [April 5, 2009, 6:40pm UTC](https://www.ruby-forum.com/t/how-to-beat-minimal-wiki-features-out-of-redcloth/164772 "2009-04-05T18:40:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phlip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Post date:** [April 5, 2009, 6:40pm UTC](https://www.ruby-forum.com/t/how-to-beat-minimal-wiki-features-out-of-redcloth/164772/1 "2009-04-05T18:40:57Z")

</div>

Rubies:

I always see “redcloth” everywhere - a textile implementation for Ruby.  
So I try  
to use it.

Firstly, my code has some

- tags and whatnot. This command line  
passed them  
through without decorating them:

ruby -e "require ‘rubygems’; require ‘redcloth’; puts  
RedCloth.new(File.read(‘README’)).to\_html " \> doc.html

Yes, it’s RedCloth 4.1.9.

I sort of expected \<li\> instead of

- . (I am aware that many  
wiki  
markups cheat and let the user author HTML directly…)

Next, some wikis use ==header== notation. redcloth took out the ==  
marks, and  
gave me just

header

Next, I have an indented code sample. Ward’s Wiki (and my old wikis)  
could  
automatically put a

```
tag around code samples. Nope.

Next, I thought markuppers should generally strew put class=‘thang’  
attributes  
around, so a CSS can color them all up. Nope.

Please don’t tell me to Google for this - I will only get blog after  
blog  
gushing about how awesome redcloth is. I’d rather hear either how to get  
these  
minimal features out of redcloth - without DIY

```
tags and such that
would
totally defeat the purpose - or hear a suggestion for a better wiki
markup library!
```
```

---

<div class="post-metadata">

**Author:** ![Phlip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Post date:** [April 5, 2009, 6:50pm UTC](https://www.ruby-forum.com/t/how-to-beat-minimal-wiki-features-out-of-redcloth/164772/2 "2009-04-05T18:50:58Z")

</div>

> Please don’t tell me to Google for this - I will only get blog after  
> blog gushing about how awesome redcloth is. I’d rather hear either how  
> to get these minimal features out of redcloth - without DIY
> 
> ```
> tags
> and such that would totally defeat the purpose - or hear a suggestion
> for a better wiki markup library!
> ```

You mean like rdoc? (-:

---

<div class="post-metadata">

**Author:** ![Phlip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Post date:** [April 5, 2009, 6:52pm UTC](https://www.ruby-forum.com/t/how-to-beat-minimal-wiki-features-out-of-redcloth/164772/3 "2009-04-05T18:52:08Z")

</div>

On Sun, Apr 5, 2009 at 9:39 AM, Phlip [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Firstly, my code has some
> 
> - tags and whatnot. This command line passed  
> them through without decorating them:
> 
> ruby -e "require ‘rubygems’; require ‘redcloth’; puts  
> RedCloth.new(File.read(‘README’)).to\_html " \> doc.html

That’s expected.

> I sort of expected \<li\> instead of
> 
> - . (I am aware that many wiki  
> markups cheat and let the user author HTML directly…)

You shouldn’t expect that out of Textile. I think you may have a  
misapprehension of what Textile is meant to do. It’s meant to make it  
easy to write a document that reads well in raw text but also can  
“compile” to nice HTML that has the same semantic meaning (more or  
less) than the plain text input.

So, don’t expect it to behave like a wiki markup language. It’s not,  
and that’s not the point of it.

> Next, some wikis use ==header== notation. redcloth took out the == marks,  
> and gave me just
> 
> header

It is strange that it took out the ==, but they’re not Textile markup  
and wouldn’t do anything. If you want a second-level header, use “h2.  
Header”

> Next, I have an indented code sample. Ward’s Wiki (and my old wikis) could  
> automatically put a
> 
> ```
> tag around code samples. Nope.
> 
> Next, I thought markuppers should generally strew put class=‘thang’  
> attributes around, so a CSS can color them all up. Nope.
> ```

Again, not features of Textile.

> Please don’t tell me to Google for this - I will only get blog after blog  
> gushing about how awesome redcloth is. I’d rather hear either how to get  
> these minimal features out of redcloth - without DIY
> 
> ```
> tags and such
> that would totally defeat the purpose - or hear a suggestion for a better
> wiki markup library!
> ```

Instead, allow me to google it for you and provide links:

[Textile (markup language) - Wikipedia](http://en.wikipedia.org/wiki/Textile_(markup_language)) – this should  
give you the background on Textile and includes links to references  
and implementations, so you can get a better idea of what it is (and  
is not) for.

[Textile Reference](http://hobix.com/textile/) – \_why’s reference. He was originally  
responsible for redcloth.

[Daring Fireball: Markdown](http://daringfireball.net/projects/markdown/) – an alternative to  
Textile that may behave somewhat closer to what you expect. BlueCloth  
handles this one, as do a few other libraries I’m not familiar with

There are also some wiki-specific markup languages implemented in  
Ruby, but I’ve never used any of them. A search for ruby wiki should  
come up with something, though you may have to dig through wiki app  
code to figure out what they’re using.

Ben

---

<div class="post-metadata">

**Author:** ![Phlip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Post date:** [April 5, 2009, 7:49pm UTC](https://www.ruby-forum.com/t/how-to-beat-minimal-wiki-features-out-of-redcloth/164772/4 "2009-04-05T19:49:34Z")

</div>

Ben B. wrote:

> [Daring Fireball: Markdown](http://daringfireball.net/projects/markdown/) – an alternative to  
> Textile that may behave somewhat closer to what you expect. BlueCloth  
> handles this one, as do a few other libraries I’m not familiar with

maruku is one of those libs and it adds some features such as tables and  
footnotes. Does have a few bugs, but what doesn’t.

---

<div class="post-metadata">

**Author:** ![Phlip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Post date:** [April 6, 2009, 3:42am UTC](https://www.ruby-forum.com/t/how-to-beat-minimal-wiki-features-out-of-redcloth/164772/5 "2009-04-06T03:42:23Z")

</div>

Joel VanderWerf wrote:

> Ben B. wrote:
> 
> > [Daring Fireball: Markdown](http://daringfireball.net/projects/markdown/) – an alternative to  
> > Textile that may behave somewhat closer to what you expect. BlueCloth  
> > handles this one, as do a few other libraries I’m not familiar with
> 
> maruku is one of those libs and it adds some features such as tables  
> and footnotes. Does have a few bugs, but what doesn’t.

Those aren’t additions. Redcloth certainly has tables and footnotes. I  
use them all the time.

Kevin, you need to study up on Textile just a bit. It isn’t tough.

t.

–

```auto
Tom C., MS MA, LMHC - Private practice Psychotherapist
Bellingham, Washington, U.S.A: (360) 920-1226
<< removed_email_address@domain.invalid >> (email)
<< TomCloyd.com >> (website)
<< sleightmind.wordpress.com >> (mental health weblog)

```

---

<div class="post-metadata">

**Author:** ![Phlip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Post date:** [April 6, 2009, 4:21am UTC](https://www.ruby-forum.com/t/how-to-beat-minimal-wiki-features-out-of-redcloth/164772/6 "2009-04-06T04:21:08Z")

</div>

Tom C. wrote:

> Kevin, you need to study up on Textile just a bit. It isn’t tough.

That was me… I’m more shocked at the blogosphere than stuck with  
Textile (-;

---

<div class="post-metadata">

**Author:** ![Phlip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Post date:** [April 6, 2009, 7:03pm UTC](https://www.ruby-forum.com/t/how-to-beat-minimal-wiki-features-out-of-redcloth/164772/7 "2009-04-06T19:03:48Z")

</div>

On Apr 5, 2009, at 09:49, Phlip wrote:

> > Please don’t tell me to Google for this - I will only get blog  
> > after blog gushing about how awesome redcloth is. I’d rather hear  
> > either how to get these minimal features out of redcloth - without  
> > DIY
> > 
> > ```
> > tags and such that would totally defeat the purpose - or
> > hear a suggestion for a better wiki markup library!
> > ```
> 
> You mean like rdoc? (-:

[http://blog.segment7.net/articles/2008/02/14/an-rdoc-wiki](http://blog.segment7.net/articles/2008/02/14/an-rdoc-wiki)

[http://segment7.net/projects/ruby/snippets/rdoc\_wiki.rb](http://segment7.net/projects/ruby/snippets/rdoc_wiki.rb) (only 200  
lines!)
