-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Convert Markdown to HTML, with XSS protection
--   
--   This library leverages existing high-performance libraries
--   (attoparsec, blaze-html, text, and conduit), and should integrate well
--   with existing codebases.
@package markdown
@version 0.1.17.5

module Text.Markdown.Inline
data Inline
InlineText :: Text -> Inline
InlineItalic :: [Inline] -> Inline
InlineBold :: [Inline] -> Inline
InlineCode :: Text -> Inline
InlineHtml :: Text -> Inline

-- | URL, title, content
InlineLink :: Text -> Maybe Text -> [Inline] -> Inline

-- | URL, title, content
InlineImage :: Text -> Maybe Text -> Text -> Inline

-- | The footnote reference in the body
InlineFootnoteRef :: Integer -> Inline
InlineFootnote :: Integer -> Inline
inlineParser :: RefMap -> Parser [Inline]
toInline :: RefMap -> Text -> [Inline]

module Text.Markdown.Block
data Block inline
BlockPara :: inline -> Block inline
BlockList :: ListType -> Either inline [Block inline] -> Block inline
BlockCode :: Maybe Text -> Text -> Block inline
BlockQuote :: [Block inline] -> Block inline
BlockHtml :: Text -> Block inline
BlockRule :: Block inline
BlockHeading :: Int -> inline -> Block inline
BlockReference :: Text -> Text -> Block inline
BlockPlainText :: inline -> Block inline
data ListType
Ordered :: ListType
Unordered :: ListType
toBlocks :: Monad m => MarkdownSettings -> ConduitM Text (Block Text) m ()
toBlockLines :: Block Text -> Block [Text]

module Text.Markdown

-- | Convert the given textual markdown content to HTML.
--   
--   <pre>
--   &gt;&gt;&gt; :set -XOverloadedStrings
--   
--   &gt;&gt;&gt; import Text.Blaze.Html.Renderer.Text
--   
--   &gt;&gt;&gt; renderHtml $ markdown def "# Hello World!"
--   "&lt;h1&gt;Hello World!&lt;/h1&gt;"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; renderHtml $ markdown def { msXssProtect = False } "&lt;script&gt;alert('evil')&lt;/script&gt;"
--   "&lt;script&gt;alert('evil')&lt;/script&gt;"
--   </pre>
markdown :: MarkdownSettings -> Text -> Html

-- | A settings type providing various configuration options.
--   
--   See <a>http://www.yesodweb.com/book/settings-types</a> for more
--   information on settings types. In general, you can use <tt>def</tt>.
data MarkdownSettings

defaultMarkdownSettings :: MarkdownSettings

-- | Whether to automatically apply XSS protection to embedded HTML.
--   Default: <tt>True</tt>.
msXssProtect :: MarkdownSettings -> Bool

-- | HTML snippets which stand on their own. We do not require a blank line
--   following these pieces of HTML.
--   
--   Default: empty set.
--   
--   Since: 0.1.2
msStandaloneHtml :: MarkdownSettings -> Set Text

-- | Handlers for the special "fenced" format. This is most commonly used
--   for fenced code, e.g.:
--   
--   <pre>
--   ```haskell
--   main = putStrLn "Hello"
--   ```
--   </pre>
--   
--   This is an extension of Markdown, but a fairly commonly used one.
--   
--   This setting allows you to create new kinds of fencing. Fencing goes
--   into two categories: parsed and raw. Code fencing would be in the raw
--   category, where the contents are not treated as Markdown. Parsed will
--   treat the contents as Markdown and allow you to perform some kind of
--   modifcation to it.
--   
--   For example, to create a new <tt>@@@</tt> fencing which wraps up the
--   contents in an <tt>article</tt> tag, you could use:
--   
--   <pre>
--   def { msFencedHandlers = htmlFencedHandler "@@@" (const "&lt;article&gt;") (const "&lt;/article")
--                `Map.union` msFencedHandlers def
--       }
--   </pre>
--   
--   Default: code fencing for <tt>```</tt> and <tt>~~~</tt>.
--   
--   Since: 0.1.2
msFencedHandlers :: MarkdownSettings -> Map Text (Text -> FencedHandler)

-- | A rendering function through which code blocks are passed.
--   
--   The arguments are the block's language, if any, and the tuple
--   <tt>(unrendered content, rendered content)</tt>. For example, if you
--   wanted to pass code blocks in your markdown text through a highlighter
--   like <tt>highlighting-kate</tt>, you might do something like:
--   
--   <pre>
--   &gt;&gt;&gt; :set -XOverloadedStrings
--   
--   &gt;&gt;&gt; let renderer lang (src,_) = formatHtmlBlock defaultFormatOpts $ highlightAs (maybe "text" unpack lang) $ unpack src
--   
--   &gt;&gt;&gt; let md = markdown def { msBlockCodeRenderer = renderer } "``` haskell\nmain = putStrLn \"Hello world!\"\n```"
--   
--   &gt;&gt;&gt; putStrLn $ renderHtml md
--   &lt;pre class="sourceCode"&gt;&lt;code class="sourceCode"&gt;main &lt;span class="fu"&gt;=&lt;/span&gt; &lt;span class="fu"&gt;putStrLn&lt;/span&gt; &lt;span class="st"&gt;&amp;quot;Hello world!&amp;quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
--   </pre>
--   
--   Since: 0.1.2.1
msBlockCodeRenderer :: MarkdownSettings -> Maybe Text -> (Text, Html) -> Html

-- | If <tt>True</tt>, all generated links have the attribute target=_blank
--   set, causing them to be opened in a new tab or window.
--   
--   Default: <tt>False</tt>
--   
--   Since 0.1.4
msLinkNewTab :: MarkdownSettings -> Bool

-- | If <tt>True</tt>, a blank line is required before the start of a
--   blockquote. Standard markdown syntax does not require a blank line
--   before a blockquote, but it is all too easy for a &gt; to end up at
--   the beginning of a line by accident.
--   
--   Default: <tt>True</tt>
--   
--   Since 0.1.5
msBlankBeforeBlockquote :: MarkdownSettings -> Bool

-- | A function to filter and/or modify parsed blocks before they are
--   written to Html
--   
--   Default: <tt>id</tt>
--   
--   Since 0.1.7
msBlockFilter :: MarkdownSettings -> [Block [Inline]] -> [Block [Inline]]

-- | If <tt>True</tt>, an <tt>id</tt> attribute is added to the heading tag
--   with the value equal to the text with only valid CSS identifier
--   characters.
--   
--   <pre>
--   ## Executive Summary
--   </pre>
--   
--   <pre>
--   &lt;h2 id="executive-summary"&gt;Executive Summary&lt;/h2&gt;
--   </pre>
--   
--   Default: <tt>False</tt>
--   
--   Since 0.1.13
msAddHeadingId :: MarkdownSettings -> Bool

-- | For external links, add the rel="nofollow" attribute
setNoFollowExternal :: MarkdownSettings -> MarkdownSettings

-- | A newtype wrapper providing a <tt>ToHtml</tt> instance.
newtype Markdown
Markdown :: Text -> Markdown

-- | See 'msFencedHandlers.
--   
--   Since 0.1.2
data FencedHandler

-- | Wrap up the given raw content.
FHRaw :: (Text -> [Block Text]) -> FencedHandler

-- | Wrap up the given parsed content.
FHParsed :: ([Block Text] -> [Block Text]) -> FencedHandler

-- | Helper for creating a <a>FHRaw</a>.
--   
--   Since 0.1.2
codeFencedHandler :: Text -> Map Text (Text -> FencedHandler)

-- | Helper for creating a <a>FHParsed</a>.
--   
--   Note that the start and end parameters take a <tt>Text</tt> parameter;
--   this is the text following the delimiter. For example, with the
--   markdown:
--   
--   <pre>
--   @@@ foo
--   </pre>
--   
--   <tt>foo</tt> would be passed to start and end.
--   
--   Since 0.1.2
htmlFencedHandler :: Text -> (Text -> Text) -> (Text -> Text) -> Map Text (Text -> FencedHandler)
def :: Default a => a
instance GHC.Show.Show Text.Markdown.Markdown
instance Data.String.IsString Text.Markdown.Markdown
instance GHC.Base.Semigroup Text.Markdown.Markdown
instance GHC.Base.Monoid Text.Markdown.Markdown
instance GHC.Classes.Ord Text.Markdown.Markdown
instance GHC.Classes.Eq Text.Markdown.Markdown
instance Text.Blaze.ToMarkup Text.Markdown.Markdown
