| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Cheapskate
Contents
Documentation
markdown :: Options -> Text -> Doc Source #
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
walk :: (Data a, Data b) => (a -> a) -> b -> b Source #
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 = xmodule Cheapskate.Types