daltoniam/bumblebee

Add documentation: parsing markdown header tags and normal paragraph text

arielelkin opened this issue · 2 comments

Please add instructions for how this can be parsed:

## This is my header

This is some normal paragraph text. 

I will try add some docs on this soon. Basically you will need to do something like this (I made this off hand, but just be the basic premise):

bee.add("##?\n", recursive: false) { (pattern: String, text: String, start: Int) -> (String, [NSObject : AnyObject]?) in
    let replace = pattern[advancedBy(pattern.startIndex, 2)... advancedBy(pattern.endIndex, -2)]
    return (replace,[NSFontAttributeName: UIFont.systemFontOfSize(24)]) //whatever your large font is
}

Added to the README.