[kramdown-users] Custom block parser

Matt Neuburg matt at tidbits.com
Wed Jan 30 15:18:02 UTC 2013

In RubyFrontier I just use erb for this. Sure, it sounds boring and old-fashioned, but it works fine. For example:

//// =====

# <%= title %>

This is cool because:

* Reason

* Another reason

//// ====

So, the stuff between the ////===== markers (I just made those up, sorry) is a kramdown document, as you can tell from the # paragraphs and the two * paragraphs. But before kramdown gets hold of it, erb has done a pass, so the <h1> content of the # paragraph has come from a variable or method called "title". 


On Jan 30, 2013, at 3:18 AM, Fedor Gusev <gusevfe at gmail.com> wrote:

> I want to create a parser to use inline Ruby code. Like
> """ ruby
> puts "This is not *funny*."
> """
> So that output would be
> This is not *funny*. 

matt neuburg, phd = matt at tidbits.com, http://www.apeth.net/matt/
pantes anthropoi tou eidenai oregontai phusei
Programming iOS 5! http://shop.oreilly.com/product/0636920023562.do
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
TidBITS, Mac news and reviews since 1990, http://www.tidbits.com

More information about the kramdown-users mailing list