BlogLiterately-0.8.1.6: A tool for posting Haskelly articles to blogs

Copyright(c) 2008-2010 Robert Greayer, 2012 Brent Yorgey
LicenseGPL (see LICENSE)
MaintainerBrent Yorgey <byorgey@gmail.com>
Safe HaskellNone
LanguageHaskell2010

Text.BlogLiterately.Block

Description

Utilities for working with code blocks.

Synopsis

Documentation

unTag :: String -> (Maybe String, String) Source

Given a block, if begins with a tag in square brackets, strip off the tag and return a pair consisting of the tag and de-tagged block. Otherwise, return Nothing and the unchanged block.

onTag :: String -> (Attr -> String -> a) -> (Block -> a) -> Block -> a Source

Run the given function on the attributes and source code of code blocks with a tag matching the given tag (case insensitive). On any other blocks (which don't have a matching tag, or are not code blocks), run the other function.