SuperRedCloth #
I’m sick of RedCloth being my most nauseating library!! All those treacherous regexps…
$ svn co http://code.whytheluckystiff.net/svn/redcloth/branches/superredcloth $ cd superredcloth $ rake
You’ll need the latest ragel installed. This will be ten times faster.
subverZion
Is That A bird? Is That a Fox? No! it’s h1.SuperRedCloth!
Manfred
Rake install :(
mdaines
Yeah! I gotta say… this kind of blows my mind! It really gets right to the point.
PaulGoscicki
If it solves at least a half of original RedCloth’s problems, it’s good enough for me :)
It’s like my every new project uses RedCloth now (which shows my addiction to textile formatting).
btw: .gem maybe?
paulsmith
Nicely done, and a great Ragel tutorial …
PaulGoscicki
Where to send bug reports? Your test_blocks() test is invalid. Three things:
why
Things I hate about RedCloth:
digit space 'x' space digit
. I don’t really like it in the first place, though. Like: 42” x 36” doesn’t work. So what’s the point?Bug reports. (Use your Rubyforge account and assign to version SUPER .)
Bil Kleb
Hot Damn! Thanks.
MenTaLguY
Ah, thank heavens. This is the way it should be done!
foca
Cuack! That’s great man :) Thanks
sandal
Cool stuff _why.
May end up doing something with this in Ruport soon :)
kristleifur
Ragel looks good. As I took Theory of Computation, I wished so hard for something exactly like it.
LninYo
Chapter ATE !!! Chapter ATE !!
Qerub
My prayers have been heard! There must be a backdoor in the MouseHole…
arcatan
I’ve been thinking writing a Textile lib with a real parser for ages. Damn you why! You win this time!
willcodeforfoo
Faster AND prettier AND more ~5x more concise… 1808 LOC vs. 326 (ish)
TonyYayo
How do I pass in :hard_breaks, etc… ie:
RedCloth.new( text, [:hard_breaks] ).to_html( :textile )
NikolasCo
No recursion. You should be able to quote a section of RedCloth and the entire blockquote should be formatted nice.
This is consistently my biggest gripe with these human-friendly-markup things. It seems that you want a simple context-free language; I recommend looking at Lemon It’s not quite as powerful as Bison but it has advantages (cleaner syntax, reentrant, etc.) OTOH , ragel+recursion should at least work.
cd
Is there a Packrat parser in Ruby btw?
why
TonyYayo: None of that is done yet. I’m working on lists and tables right now.
NikolasCo: I started using Lemon for this, actually, but it felt like too much. Textile isn’t begging to be broken up into tokens and structs. It just needs to be transformed.
I think bison is reentrant, but yacc isn’t. I’ve always really liked yacc/bison syntax actually, even though it was painful to learn because shift-reduce wasn’t explained very well when I first started using it some time ago.
Anyway, if anyone out there wants to learn Lemon, check out the lighttpd source. The configparser.y illustrates perfectly.
Hank o`o
USING ALL MY RAM ! DAMN YOU _WHY!!!
Is it normal for it to use 800M of memory during rake?
Hank o`o
OK – found the problem. DO NOT UNDER ANY CIRCUMSTANCES USE THE DEBAIN APT -INSTALLABLE RAGEL !
Compile 5.16 for yourself.
Hank o`o
199 tests, 199 assertions, 58 failures, 0 errors rake aborted!
:( Debug time.
why
Slow down there. It’s using the tests from RedCloth 3. And I haven’t even finished with lists or tables yet. Most other things are perfect and some whitespace in the tests doesn’t match up.
Yes, don’t use anything less than Ragel 5.16!
Tekno
Links oh the links, why do they fail me!
Probably because I used an ‘&’ in the text for the link!
the word definition in superredcloth_inline.rl:92 needs to be adjusted to accept various punctuation characters.
ehird
Boom. No worky.
tilman
ehird: this patch should fix it
post.user - 2
tilman: doesn’t apply
tilman
Sure it does, just tested it again.
ehird
well… doesn’t here.
AdrianThurston
Hank o`o: Could you tell me which older version of Ragel that was?
tilman
ehird: tried running “patch -p0 -i thepatch.diff” from the checked out directory?
Hanko`o
AdrianThursto: apt-cache show ragel: Version: 5.7-1
OLDDDD …
tilman
odd, i was doing that, but now it works :/
it’s fast.
ehird
er. how did that happen.
ehird
er. how did that happen.
AdrianThurston
Hanko `o: thanks!
Nikolas Coukouma
I checked the Bison manual and generating reentrant parsers isn’t the default, but can be enabled via an option . Old-fashioned YACC doesn’t seem to have an equivalent.