-
Notifications
You must be signed in to change notification settings - Fork 17
Home
tristanjuricek edited this page Sep 13, 2010
·
3 revisions
This time, with an object model!
Because you want to mess with your Markdown output, that’s why! Say you want to HTML-ify your markdown document. Why not use the first header of the Markdown as the <title>
of the <head>
?
Or default it to do something.
val blocks = KnockOff.parse( markdownSource ).get val header = blocks.find( _.isInstanceOf[ Header ] ) match { case header:Header => SpanConverter( header.nads ).toString case None => "My Default Header" }
Note that the object model and the “conversion” process is pretty alpha at this point. I haven’t used it much yet. That whole SpanConverter
thing will get pimped at some point, probably to header.nads.text
.