# \[ANN\] BlueCloth: a Markdown implementation for Ruby

**URL:** <https://rubytalk.org/t/ann-bluecloth-a-markdown-implementation-for-ruby/11002>\
**Category:** ruby-talk\
**Created:** [14 April 2004 14:07 UTC](https://rubytalk.org/t/ann-bluecloth-a-markdown-implementation-for-ruby/11002 "2004-04-14T14:07:29Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Granger](https://avatars.discourse-cdn.com/v4/letter/m/a88e4f/32.png) [@Michael\_Granger](https://rubytalk.org/u/Michael_Granger)\
**Post date:** [14 April 2004 14:07 UTC](https://rubytalk.org/t/ann-bluecloth-a-markdown-implementation-for-ruby/11002/1 "2004-04-14T14:07:29Z")

</div>

Hi all,

I just wanted to announce the initial (alpha) release of a Ruby  
implementation of Markdown, which is a text-to-HTML conversion tool for  
web writers, similar to Textile. It borrows the interface from and is  
inspired by Why the Lucky Stiff’s “RedCloth” library, which is a Ruby  
implementation of Textile, and is intended to be used as a drop-in  
replacement for it when one wishes to use Markdown syntax instead.

You can find more information at [http://bluecloth.rubyforge.org/](http://bluecloth.rubyforge.org/),  
including downloads and a small example of the syntax. Much more  
information can be had about Markdown itself at  
[http://daringfireball.net/projects/markdown/](http://daringfireball.net/projects/markdown/).

> **···**
>
> –  
> Michael Granger [ged@FaerieMUD.org](mailto:ged@FaerieMUD.org)  
> Rubymage, Believer, Architect  
> The FaerieMUD Consortium [http://www.FaerieMUD.org/](http://www.FaerieMUD.org/)

---

<div class="post-metadata">

**Author:** ![Jim\_Moy](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@Jim\_Moy](https://rubytalk.org/u/Jim_Moy)\
**Post date:** [14 April 2004 14:47 UTC](https://rubytalk.org/t/ann-bluecloth-a-markdown-implementation-for-ruby/11002/2 "2004-04-14T14:47:18Z")

</div>

Nice, I’d just run upon Markdown a few days ago and immediately wondered  
when someone would do a Ruby version 🙂 So am I right in thinking  
this would plug into Instiki pretty readily?

Jim

Michael Granger wrote:

> Hi all,
> 
> I just wanted to announce the initial (alpha) release of a Ruby  
> implementation of Markdown, which is a text-to-HTML conversion tool for  
> web writers, similar to Textile. It borrows the interface from and is  
> …

---

<div class="post-metadata">

**Author:** ![Laurent\_Julliard4](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@Laurent\_Julliard4](https://rubytalk.org/u/Laurent_Julliard4)\
**Post date:** [14 April 2004 16:04 UTC](https://rubytalk.org/t/ann-bluecloth-a-markdown-implementation-for-ruby/11002/3 "2004-04-14T16:04:13Z")

</div>

lovely, thanks for this. I just noticed this project on rubyforge and  
suddenly a message popped here 🙂

And funny name too :), now we just miss a SnakeCloth ( reST parser)

> **···**
>
> il Wed, 14 Apr 2004 23:07:29 +0900, Michael Granger [ged@FaerieMUD.org](mailto:ged@FaerieMUD.org) ha scritto::
> 
> > Hi all,
> > 
> > I just wanted to announce the initial (alpha) release of a Ruby  
> > implementation of Markdown, which is a text-to-HTML conversion tool for  
> > web writers, similar to Textile.

---

<div class="post-metadata">

**Author:** ![John\_Long2](https://avatars.discourse-cdn.com/v4/letter/j/e9c0ed/32.png) [@John\_Long2](https://rubytalk.org/u/John_Long2)\
**Post date:** [14 April 2004 23:00 UTC](https://rubytalk.org/t/ann-bluecloth-a-markdown-implementation-for-ruby/11002/4 "2004-04-14T23:00:20Z")

</div>

Wow! I was working on my own translation. And I had wanted to make it work  
like RedCloth. Need any help with it?

> **···**
>
> –  
> John

---

<div class="post-metadata">

**Author:** ![Michael\_Granger](https://avatars.discourse-cdn.com/v4/letter/m/a88e4f/32.png) [@Michael\_Granger](https://rubytalk.org/u/Michael_Granger)\
**Post date:** [14 April 2004 15:54 UTC](https://rubytalk.org/t/ann-bluecloth-a-markdown-implementation-for-ruby/11002/5 "2004-04-14T15:54:23Z")

</div>

Yes. I’m actually doing so for a local Instiki I’ve been playing around  
with. It requires a bit more work than I’d hoped because Instiki  
assumes a few things about the syntax of the page source that aren’t  
true of Markdown, but they’re pretty easy changes, I think.

If I get things working well enough, I’ll contribute a patch back to  
Instiki for it.

> **···**
>
> On Apr 14, 2004, at 7:47 AM, Jim Moy wrote:
> 
> > Nice, I’d just run upon Markdown a few days ago and immediately  
> > wondered when someone would do a Ruby version 🙂 So am I right in  
> > thinking this would plug into Instiki pretty readily?
> 
> –  
> Michael Granger [ged@FaerieMUD.org](mailto:ged@FaerieMUD.org)  
> Rubymage, Believer, Architect  
> The FaerieMUD Consortium [http://www.FaerieMUD.org/](http://www.FaerieMUD.org/)

---

<div class="post-metadata">

**Author:** ![why\_the\_lucky\_stiff1](https://avatars.discourse-cdn.com/v4/letter/w/898d66/32.png) [@why\_the\_lucky\_stiff1](https://rubytalk.org/u/why_the_lucky_stiff1)\
**Post date:** [14 April 2004 16:19 UTC](https://rubytalk.org/t/ann-bluecloth-a-markdown-implementation-for-ruby/11002/6 "2004-04-14T16:19:21Z")

</div>

gabriele renzi wrote:

> And funny name too :), now we just miss a SnakeCloth ( reST parser)

agreed. hilarious, m.g.!

\_why

---

<div class="post-metadata">

**Author:** ![Aredridel1](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@Aredridel1](https://rubytalk.org/u/Aredridel1)\
**Post date:** [14 April 2004 16:29 UTC](https://rubytalk.org/t/ann-bluecloth-a-markdown-implementation-for-ruby/11002/7 "2004-04-14T16:29:10Z")

</div>

You, too, eh?

I was going to write something like this when I got free time next.  
Looks like I was beaten to the punch on a great idea. (Markdown gets  
marks for this: It’s captured a lot of mindshare in a hurry!)

Ari

> **···**
>
> On Wed, Apr 14, 2004 at 11:47:18PM +0900, Jim Moy wrote:
> 
> > Nice, I’d just run upon Markdown a few days ago and immediately  
> > wondered when someone would do a Ruby version 🙂 So am I right in  
> > thinking this would plug into Instiki pretty readily?

---

<div class="post-metadata">

**Author:** ![Michael\_Granger](https://avatars.discourse-cdn.com/v4/letter/m/a88e4f/32.png) [@Michael\_Granger](https://rubytalk.org/u/Michael_Granger)\
**Post date:** [14 April 2004 23:36 UTC](https://rubytalk.org/t/ann-bluecloth-a-markdown-implementation-for-ruby/11002/8 "2004-04-14T23:36:33Z")

</div>

It’s already complete implementation-wise, as far as I know, but it  
could use some usage-level testing. I’m integrating it with several of  
my own projects, but have yet to really hammer on it to any great  
degree.

Several people have mentioned that they were possibly interested in  
contributing features, and a few have already sent patches, but if you  
or anyone else has ideas about how it could be better, then I’m  
interested in hearing those, too.

> **···**
>
> On Apr 14, 2004, at 4:00 PM, John W. Long wrote:
> 
> > Wow! I was working on my own translation. And I had wanted to make it  
> > work  
> > like RedCloth. Need any help with it?
> 
> –  
> Michael Granger [ged@FaerieMUD.org](mailto:ged@FaerieMUD.org)  
> Rubymage, Architect, Believer  
> The FaerieMUD Consortium [http://www.FaerieMUD.org/](http://www.FaerieMUD.org/)

---

<div class="post-metadata">

**Author:** ![Curt\_Hibbs3](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@Curt\_Hibbs3](https://rubytalk.org/u/Curt_Hibbs3)\
**Post date:** [14 April 2004 17:45 UTC](https://rubytalk.org/t/ann-bluecloth-a-markdown-implementation-for-ruby/11002/9 "2004-04-14T17:45:21Z")

</div>

Michael Granger wrote:

> > Nice, I’d just run upon Markdown a few days ago and immediately  
> > wondered when someone would do a Ruby version 🙂 So am I right in  
> > thinking this would plug into Instiki pretty readily?
> 
> Yes. I’m actually doing so for a local Instiki I’ve been playing around  
> with. It requires a bit more work than I’d hoped because Instiki  
> assumes a few things about the syntax of the page source that aren’t  
> true of Markdown, but they’re pretty easy changes, I think.
> 
> If I get things working well enough, I’ll contribute a patch back to  
> Instiki for it.

Please do!

I really like Markdown and Instiki and I look forward to using them  
together.

Curt

> **···**
>
> > On Apr 14, 2004, at 7:47 AM, Jim Moy wrote:

---

<div class="post-metadata">

**Author:** ![Chad\_Fowler](https://avatars.discourse-cdn.com/v4/letter/c/5daacb/32.png) [@Chad\_Fowler](https://rubytalk.org/u/Chad_Fowler)\
**Post date:** [15 April 2004 00:37 UTC](https://rubytalk.org/t/ann-bluecloth-a-markdown-implementation-for-ruby/11002/10 "2004-04-15T00:37:24Z")

</div>

It works very nicely with RubLog too! Nice simple stuff!

Chad

> **···**
>
> On 14/4/2004, at 11:54 AM, Michael Granger wrote:
> 
> > On Apr 14, 2004, at 7:47 AM, Jim Moy wrote:
> > 
> > > Nice, I’d just run upon Markdown a few days ago and immediately  
> > > wondered when someone would do a Ruby version 🙂 So am I right in  
> > > thinking this would plug into Instiki pretty readily?
> > 
> > Yes. I’m actually doing so for a local Instiki I’ve been playing  
> > around with. It requires a bit more work than I’d hoped because  
> > Instiki assumes a few things about the syntax of the page source that  
> > aren’t true of Markdown, but they’re pretty easy changes, I think.

---

<div class="post-metadata">

**Author:** ![David\_Heinemeier\_Ha2](https://avatars.discourse-cdn.com/v4/letter/d/fbc32d/32.png) [@David\_Heinemeier\_Ha2](https://rubytalk.org/u/David_Heinemeier_Ha2)\
**Post date:** [15 April 2004 09:46 UTC](https://rubytalk.org/t/ann-bluecloth-a-markdown-implementation-for-ruby/11002/11 "2004-04-15T09:46:10Z")

</div>

> If I get things working well enough, I’ll contribute a patch back to  
> Instiki for it.

Oh, please do. Florian Gloss contributed proper getopts support, which  
will be released shortly. This should make it easier to control the  
syntax engine. The default will stay on RedCloth, but it’s great to  
allow for other syntaxes as well as a startup option.

Which assumptions about syntax are holding you back?

> **···**
>
> –  
> David Heinemeier Hansson,  
> [http://instiki.nextangle.com/](http://instiki.nextangle.com/) – A No-Step-Three Wiki in Ruby  
> [http://www.basecamphq.com/](http://www.basecamphq.com/) – Web-based Project Management  
> [http://www.loudthinking.com/](http://www.loudthinking.com/) – Broadcasting Brain

---

<div class="post-metadata">

**Author:** ![Florian\_Gross](https://avatars.discourse-cdn.com/v4/letter/f/e9a140/32.png) [@Florian\_Gross](https://rubytalk.org/u/Florian_Gross)\
**Post date:** [15 April 2004 12:34 UTC](https://rubytalk.org/t/ann-bluecloth-a-markdown-implementation-for-ruby/11002/12 "2004-04-15T12:34:12Z")

</div>

David Heinemeier Hansson wrote:

> > If I get things working well enough, I’ll contribute a patch back to  
> > Instiki for it.  
> > Oh, please do. Florian Gloss contributed proper getopts support, which  
> > will be released shortly. This should make it easier to control the  
> > syntax engine. The default will stay on RedCloth, but it’s great to  
> > allow for other syntaxes as well as a startup option.

Should be quite easy to do: The only line referencing RedCloth is in  
revisions.rb.

The bigger question is whether to include both libraries, but I think  
that can safely be answered with ‘yes’. (Another 29 KB shouldn’t be  
exactly critical.)

---

<div class="post-metadata">

**Author:** ![David\_Heinemeier\_Ha2](https://avatars.discourse-cdn.com/v4/letter/d/fbc32d/32.png) [@David\_Heinemeier\_Ha2](https://rubytalk.org/u/David_Heinemeier_Ha2)\
**Post date:** [15 April 2004 14:52 UTC](https://rubytalk.org/t/ann-bluecloth-a-markdown-implementation-for-ruby/11002/13 "2004-04-15T14:52:49Z")

</div>

> Should be quite easy to do: The only line referencing RedCloth is in  
> revisions.rb.
> 
> The bigger question is whether to include both libraries, but I think  
> that can safely be answered with ‘yes’. (Another 29 KB shouldn’t be  
> exactly critical.)

Yearh, definitely. I think it could be pretty cool to have RDoc syntax  
as well. That way you could very easily copy/paste a bunch of code  
comments into a wiki and edit it from there. Oh and of course also use  
that for any wiki if you were so inclined.

> **···**
>
> –  
> David Heinemeier Hansson,  
> [http://instiki.nextangle.com/](http://instiki.nextangle.com/) – A No-Step-Three Wiki in Ruby  
> [http://www.basecamphq.com/](http://www.basecamphq.com/) – Web-based Project Management  
> [http://www.loudthinking.com/](http://www.loudthinking.com/) – Broadcasting Brain

---

<div class="post-metadata">

**Author:** ![John\_Long2](https://avatars.discourse-cdn.com/v4/letter/j/e9c0ed/32.png) [@John\_Long2](https://rubytalk.org/u/John_Long2)\
**Post date:** [15 April 2004 23:31 UTC](https://rubytalk.org/t/ann-bluecloth-a-markdown-implementation-for-ruby/11002/14 "2004-04-15T23:31:00Z")

</div>

In reference to Instiki:

----- “David Heinemeier Hansson” wrote: -----

> > Should be quite easy to do: The only line referencing RedCloth is in  
> > revisions.rb.
> > 
> > The bigger question is whether to include both libraries, but I think  
> > that can safely be answered with ‘yes’. (Another 29 KB shouldn’t be  
> > exactly critical.)
> 
> Yearh, definitely. I think it could be pretty cool to have RDoc syntax  
> as well. That way you could very easily copy/paste a bunch of code  
> comments into a wiki and edit it from there. Oh and of course also use  
> that for any wiki if you were so inclined.

Or even better allow the user to run multiple filters on the markup. Drop  
filters in a filters folder and instantly you have access to different kinds  
of markup. You could have check boxes for the filters you want to run on a  
per post basis along with the ability to set the defaults.

> **···**
>
> –  
> John

---

<div class="post-metadata">

**Author:** ![Chad\_Fowler](https://avatars.discourse-cdn.com/v4/letter/c/5daacb/32.png) [@Chad\_Fowler](https://rubytalk.org/u/Chad_Fowler)\
**Post date:** [16 April 2004 00:58 UTC](https://rubytalk.org/t/ann-bluecloth-a-markdown-implementation-for-ruby/11002/15 "2004-04-16T00:58:38Z")

</div>

This is the approach rublog takes with its Convertors. Works very  
nicely.

Chad

> **···**
>
> On 15/4/2004, at 7:31 PM, John W. Long wrote:
> 
> > In reference to Instiki:
> > 
> > ----- “David Heinemeier Hansson” wrote: -----
> > 
> > > > Should be quite easy to do: The only line referencing RedCloth is in  
> > > > revisions.rb.
> > > > 
> > > > The bigger question is whether to include both libraries, but I think  
> > > > that can safely be answered with ‘yes’. (Another 29 KB shouldn’t be  
> > > > exactly critical.)
> > > 
> > > Yearh, definitely. I think it could be pretty cool to have RDoc syntax  
> > > as well. That way you could very easily copy/paste a bunch of code  
> > > comments into a wiki and edit it from there. Oh and of course also use  
> > > that for any wiki if you were so inclined.
> > 
> > Or even better allow the user to run multiple filters on the markup.  
> > Drop  
> > filters in a filters folder and instantly you have access to different  
> > kinds  
> > of markup. You could have check boxes for the filters you want to run  
> > on a  
> > per post basis along with the ability to set the defaults.

---

<div class="post-metadata">

**Author:** ![David\_Heinemeier\_Ha2](https://avatars.discourse-cdn.com/v4/letter/d/fbc32d/32.png) [@David\_Heinemeier\_Ha2](https://rubytalk.org/u/David_Heinemeier_Ha2)\
**Post date:** [16 April 2004 21:57 UTC](https://rubytalk.org/t/ann-bluecloth-a-markdown-implementation-for-ruby/11002/16 "2004-04-16T21:57:14Z")

</div>

> Or even better allow the user to run multiple filters on the markup.  
> Drop  
> filters in a filters folder and instantly you have access to different  
> kinds  
> of markup. You could have check boxes for the filters you want to run  
> on a  
> per post basis along with the ability to set the defaults.

I like the simplicity of dropping in a file and having that syntax  
available, but I’m hesitant to add filter controls to the in-wiki  
interface. It’s one thing that the command-line options are growing,  
another to complicate what’s facing the wiki user.

So I see options like markup choices and the like to lie with the wiki  
administrator.

> **···**
>
> –  
> David Heinemeier Hansson,  
> [http://instiki.nextangle.com/](http://instiki.nextangle.com/) – A No-Step-Three Wiki in Ruby  
> [http://www.basecamphq.com/](http://www.basecamphq.com/) – Web-based Project Management  
> [http://www.loudthinking.com/](http://www.loudthinking.com/) – Broadcasting Brain

---

<div class="post-metadata">

**Author:** ![Curt\_Hibbs3](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@Curt\_Hibbs3](https://rubytalk.org/u/Curt_Hibbs3)\
**Post date:** [17 April 2004 03:11 UTC](https://rubytalk.org/t/ann-bluecloth-a-markdown-implementation-for-ruby/11002/17 "2004-04-17T03:11:39Z")

</div>

David Heinemeier Hansson wrote:

> So I see options like markup choices and the like to lie with the wiki  
> administrator.

I agree with this!

Curt
