zrajm
zrajm

Reputation: 1391

Extendable Markdown parser in Ruby?

I'm looking to redo/update a webpage of mine (Klingonska Akademien) to bring it up to speed with what has been happing with HTML and CSS the last ten years or so. :) In my research this far I've concluded that I probably want to use Rake and Sass so I'm thinking I might as well stick to Ruby as much as possible.

That being said, I need an extendable Markdown parser. I've had a look at Redcarpet, but it seems that only the renderer side of thing is extendable, not the parser (understandable with their security and speed requirements—but speed isn't all that important to me). So I can't add my own markup.

Now I already have tons of texts on the Klingon Language that I want to reuse, in which {...} mark text in Klingon, and <...> mark translations thereof. I'd like this rendered as <b lang="tlh">...</b> and <i class="transl">...</i> in HTML output, but I also need to further process the content of {...} to insert hyphenation points.

Does there exist a Ruby-based Markdown parser where one can add own markup in this way?

If not, is there a parser which could pretty easily be modified to do this? (For me that would mean: well writted/documented code, and written in Ruby only.)

Upvotes: 5

Views: 744

Answers (1)

Hauleth
Hauleth

Reputation: 23566

Look at Kramdown. It has a lot of advantages over Redcarpet but I'm using second one due it is very fast. But sometimes Kramdown is better option.

Upvotes: 3

Related Questions