cheapskate- Experimental markdown processor.

Safe HaskellNone




markdown :: Options -> Text -> DocSource

Parses the input as a markdown document. Note that Doc is an instance of ToMarkup, so the document can be converted to Html using toHtml. A simple Text to Html filter would be

 markdownToHtml :: Text -> Html
 markdownToHtml = toHtml . markdown def

def :: Default a => a

The default value for this type.

walk :: (Data a, Data b) => (a -> a) -> b -> bSource

Apply a transformation bottom-up to every node of a parsed document. This can be used, for example, to transform specially marked code blocks to highlighted code or images. Here is a simple example that promotes the levels of headers:

 promoteHeaders :: Doc -> Doc
 promoteHeaders = walk promoteHeader
   where promoteHeader (Header n ils) = Header (n+1) ils
         promoteHeader x              = x

walkM :: (Data a, Data b, Monad m) => (a -> m a) -> b -> m bSource

Monadic version of walk.