Forum: Ruby how to beat minimal wiki features out of redcloth?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Aafa8848c4b764f080b1b31a51eab73d?d=identicon&s=25 Phlip (Guest)
on 2009-04-05 18:40
(Received via mailing list)
Rubies:

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

Firstly, my code has some <li> 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 &lt;li&gt; instead of <li>. (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 <p>header</p>

Next, I have an indented code sample. Ward's Wiki (and my old wikis)
could
automatically put a <pre> 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 <pre> tags and such that
would
totally defeat the purpose - or hear a suggestion for a better wiki
markup library!
Aafa8848c4b764f080b1b31a51eab73d?d=identicon&s=25 Phlip (Guest)
on 2009-04-05 18:50
(Received via mailing list)
> 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 <pre> tags
> and such that would totally defeat the purpose - or hear a suggestion
> for a better wiki markup library!

You mean like rdoc? (-:
90a73d9875462aaa9fab2feffafbffe7?d=identicon&s=25 Ben Bleything (Guest)
on 2009-04-05 18:52
(Received via mailing list)
On Sun, Apr 5, 2009 at 9:39 AM, Phlip <phlip2005@gmail.com> wrote:
> Firstly, my code has some <li> 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 &lt;li&gt; instead of <li>. (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 <p>header</p>

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 <pre> 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 <pre> 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:

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.

http://hobix.com/textile/ -- _why's reference.  He was originally
responsible for redcloth.

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
47b1910084592eb77a032bc7d8d1a84e?d=identicon&s=25 Joel VanderWerf (Guest)
on 2009-04-05 19:49
(Received via mailing list)
Ben Bleything wrote:
> 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.
D15a45a973443d4562051eb675b60474?d=identicon&s=25 Tom Cloyd (Guest)
on 2009-04-06 03:42
(Received via mailing list)
Joel VanderWerf wrote:
> Ben Bleything wrote:
>> 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.

--

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tom Cloyd, MS MA, LMHC - Private practice Psychotherapist
Bellingham, Washington, U.S.A: (360) 920-1226
<< tc@tomcloyd.com >> (email)
<< TomCloyd.com >> (website)
<< sleightmind.wordpress.com >> (mental health weblog)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Aafa8848c4b764f080b1b31a51eab73d?d=identicon&s=25 Phlip (Guest)
on 2009-04-06 04:21
(Received via mailing list)
Tom Cloyd 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 (-;
58479f76374a3ba3c69b9804163f39f4?d=identicon&s=25 Eric Hodel (Guest)
on 2009-04-06 19:03
(Received via mailing list)
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 <pre> 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://segment7.net/projects/ruby/snippets/rdoc_wiki.rb (only 200
lines!)
This topic is locked and can not be replied to.