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


-- | Commonly useful extensions for the MMark markdown processor
--   
--   Commonly useful extensions for the MMark markdown processor. Click on
--   <a>Text.MMark.Extension.Common</a> to get started.
@package mmark-ext
@version 0.2.1.0


-- | Turn paragraphs into comments by prefixing them with a certain
--   sequence of characters.
module Text.MMark.Extension.Comment

-- | This extension removes top-level paragraphs starting with the given
--   sequence of non-markup characters.
commentParagraph :: Text -> Extension


-- | Turn links into Font Awesome icons.
module Text.MMark.Extension.FontAwesome

-- | Allow to insert <tt>span</tt>s with font awesome icons using autolinks
--   like this:
--   
--   <pre>
--   &lt;fa:user&gt;
--   </pre>
--   
--   This <tt>user</tt> identifier is the name of icon you want to insert.
--   You can also control the size of the icon like this:
--   
--   <pre>
--   &lt;fa:user/fw&gt; -- fixed width
--   &lt;fa:user/lg&gt; -- large
--   &lt;fa:user/2x&gt;
--   &lt;fa:user/3x&gt;
--   &lt;fa:user/4x&gt;
--   &lt;fa:user/5x&gt;
--   </pre>
--   
--   In general, all path components in this URI that go after the name of
--   icon will be prefixed with <tt>"fa-"</tt> and added as classes, so you
--   can do a lot of fancy stuff, see
--   <a>http://fontawesome.io/examples/</a>:
--   
--   <pre>
--   &lt;fa:quote-left/3x/pull-left/border&gt;
--   </pre>
--   
--   See also: <a>http://fontawesome.io</a>.
fontAwesome :: Extension


-- | An extension to add footnotes to your documents.
module Text.MMark.Extension.Footnotes

-- | The extension performs two transformations:
--   
--   <ul>
--   <li>It turns links with URIs with <tt>footnote</tt> scheme and single
--   path piece consisting of a number into links to footnote
--   references.</li>
--   <li>It turns block quotes with the <tt>"footnotes"</tt> label (see the
--   example below) into a footnote section.</li>
--   </ul>
--   
--   <pre>
--   Here goes some text [1](footnote:1).
--   
--   &gt; footnotes
--   
--     1. Here we have the footnote.
--   </pre>
--   
--   The extension is not fully safe though in the sense that we can't
--   check that a footnote reference refers to an existing footnote and
--   that footnotes have corresponding references, or that they are present
--   in the document in the right order.
footnotes :: Extension


-- | Use the <tt>ghc-syntax-highlighter</tt> package to highlight Haskell
--   code. This module only works with GHC 8.4.1 and newer (with older
--   versions the extension just won't have any effect).
module Text.MMark.Extension.GhcSyntaxHighlighter

-- | Use the <tt>ghc-syntax-highlighter</tt> package to highlight Haskell
--   code. The extension is applied only to code blocks with info string
--   <tt>"haskell"</tt>.
--   
--   The resulting code block will be wrapped in a <tt>div</tt> with class
--   <tt>"source-code"</tt>. The following <tt>span</tt> classes can be
--   used for styling:
--   
--   <ul>
--   <li><a>KeywordTok</a> = <tt>"kw"</tt></li>
--   <li><a>PragmaTok</a> = <tt>"pr"</tt></li>
--   <li><a>SymbolTok</a> = <tt>"sy"</tt></li>
--   <li><a>VariableTok</a> = <tt>"va"</tt></li>
--   <li><a>ConstructorTok</a> = <tt>"cr"</tt></li>
--   <li><a>OperatorTok</a> = <tt>"op"</tt></li>
--   <li><a>CharTok</a> = <tt>"ch"</tt></li>
--   <li><a>StringTok</a> = <tt>"st"</tt></li>
--   <li><a>IntegerTok</a> = <tt>"it"</tt></li>
--   <li><a>RationalTok</a> = <tt>"ra"</tt></li>
--   <li><a>CommentTok</a> = <tt>"co"</tt></li>
--   <li><a>SpaceTok</a> = no</li>
--   <li><a>OtherTok</a> = <tt>"ot"</tt></li>
--   </ul>
--   
--   To use with <a>skylighting</a> the extension should be applied
--   <i>after</i> the <a>skylighting</a> extension so it can overwrite its
--   logic for code block with <tt>"haskell"</tt> info string. So place it
--   on the left hand side of <tt>(<a>&lt;&gt;</a>)</tt> or above
--   <a>skylighting</a> in the list passed to <a>useExtensions</a>.
ghcSyntaxHighlighter :: Extension


-- | Introduce <tt>kbd</tt> tags into resulting HTML document by wrapping
--   content in links with URL with <tt>kbd</tt> scheme.
module Text.MMark.Extension.Kbd

-- | Introduce <tt>kbd</tt> tags into resulting HTML document by wrapping
--   content in links with URL with <tt>kbd</tt> scheme.
--   
--   For example:
--   
--   <pre>
--   To enable that mode press [Ctrl+A][kbd].
--   
--   [kbd]: kbd:
--   </pre>
--   
--   The use of reference-style links seems more aesthetically pleasant to
--   the author, but you can of course do somethnig like this instead:
--   
--   <pre>
--   To enable that mode press [Ctrl+A](kbd:).
--   </pre>
kbd :: Extension


-- | Specify the <tt>target</tt> attribute of links in link titles. This
--   allows, e.g. make a link open in new tab.
module Text.MMark.Extension.LinkTarget

-- | When title of a link starts with the word <tt>"_blank"</tt>,
--   <tt>"_self"</tt>, <tt>"_parent"</tt>, or <tt>"_top"</tt>, it's
--   stripped from title (as well as all whitespace after it) and added as
--   the value of <tt>target</tt> attribute of the resulting link.
--   
--   For example:
--   
--   <pre>
--   This [link](/url '_blank My title') opens in new tab.
--   </pre>
linkTarget :: Extension


-- | Turn code spans and fenced code blocks into MathJax formulas.
module Text.MMark.Extension.MathJax

-- | The extension allows to transform inline code spans into MathJax
--   inline spans and code blocks with the info string <tt>"mathjax"</tt>
--   (case-sensitive) into MathJax display spans. Every line in such a code
--   block will produce a separate display span, i.e. a separate line with
--   a formula (which is probably what you want anyway).
--   
--   The first argument is the character that must be the first and the
--   last character in code spans for them to be recognized as MathJax
--   markup. If <a>Nothing</a> is passed instead of a char, we apply the
--   transformation to all code spans (useful for more academic articles
--   that do not deal with code).
mathJax :: Maybe Char -> Extension


-- | Obfuscate email addresses.
module Text.MMark.Extension.ObfuscateEmail

-- | This extension makes email addresses in autolinks be rendered as
--   something like this:
--   
--   <pre>
--   &lt;a class="protected-email"
--      data-email="something@example.org"
--      href="javascript:void(0)"&gt;Enable JavaScript to see this email&lt;/a&gt;
--   </pre>
--   
--   You'll also need to include jQuery and this bit of JS code for the
--   magic to work:
--   
--   <pre>
--   $(document).ready(function () {
--       $(".protected-email").each(function () {
--           var item = $(this);
--           var email = item.data('email');
--           item.attr('href', 'mailto:' + email);
--           item.html(email);
--       });
--   });
--   </pre>
obfuscateEmail :: Text -> Extension


-- | Punctuation prettifier.
module Text.MMark.Extension.PunctuationPrettifier

-- | Prettify punctuation (only affects plain text in inlines):
--   
--   <ul>
--   <li>Replace <tt>...</tt> with ellipsis <tt>…</tt></li>
--   <li>Replace <tt>---</tt> with em-dash <tt>—</tt></li>
--   <li>Replace <tt>--</tt> with en-dash <tt>–</tt></li>
--   <li>Replace <tt>"</tt> with left double quote <tt>“</tt> when previous
--   character was a space character, otherwise replace it with right
--   double quote <tt>”</tt></li>
--   <li>Replace <tt>'</tt> with left single quote <tt>‘</tt> when previous
--   character was a space character, otherwise replace it with right
--   single quote <tt>’</tt> aka apostrophe</li>
--   </ul>
punctuationPrettifier :: Extension


-- | Use the Skylighting library to highlight code snippets.
module Text.MMark.Extension.Skylighting

-- | Use the <tt>skylighting</tt> package to render code blocks with info
--   strings that result in a successful lookup from
--   <a>defaultSyntaxMap</a>.
--   
--   The resulting code block will be wrapped in a <tt>div</tt> with class
--   <tt>"source-code"</tt>. The following <tt>span</tt> classes can be
--   used for styling:
--   
--   <ul>
--   <li><a>AlertTok</a> = <tt>"al"</tt></li>
--   <li><a>AnnotationTok</a> = <tt>"an"</tt></li>
--   <li><a>AttributeTok</a> = <tt>"at"</tt></li>
--   <li><a>BaseNTok</a> = <tt>"bn"</tt></li>
--   <li><a>BuiltInTok</a> = <tt>"bu"</tt></li>
--   <li><a>CharTok</a> = <tt>"ch"</tt></li>
--   <li><a>CommentTok</a> = <tt>"co"</tt></li>
--   <li><a>CommentVarTok</a> = <tt>"cv"</tt></li>
--   <li><a>ConstantTok</a> = <tt>"cn"</tt></li>
--   <li><a>ControlFlowTok</a> = <tt>"cf"</tt></li>
--   <li><a>DataTypeTok</a> = <tt>"dt"</tt></li>
--   <li><a>DecValTok</a> = <tt>"dv"</tt></li>
--   <li><a>DocumentationTok</a> = <tt>"do"</tt></li>
--   <li><a>ErrorTok</a> = <tt>"er"</tt></li>
--   <li><a>ExtensionTok</a> = <tt>"ex"</tt></li>
--   <li><a>FloatTok</a> = <tt>"fl"</tt></li>
--   <li><a>FunctionTok</a> = <tt>"fu"</tt></li>
--   <li><a>ImportTok</a> = <tt>"im"</tt></li>
--   <li><a>InformationTok</a> = <tt>"in"</tt></li>
--   <li><a>KeywordTok</a> = <tt>"kw"</tt></li>
--   <li><a>OperatorTok</a> = <tt>"op"</tt></li>
--   <li><a>OtherTok</a> = <tt>"ot"</tt></li>
--   <li><a>PreprocessorTok</a> = <tt>"pp"</tt></li>
--   <li><a>RegionMarkerTok</a> = <tt>"re"</tt></li>
--   <li><a>SpecialCharTok</a> = <tt>"sc"</tt></li>
--   <li><a>SpecialStringTok</a> = <tt>"ss"</tt></li>
--   <li><a>StringTok</a> = <tt>"st"</tt></li>
--   <li><a>VariableTok</a> = <tt>"va"</tt></li>
--   <li><a>VerbatimStringTok</a> = <tt>"vs"</tt></li>
--   <li><a>WarningTok</a> = <tt>"wa"</tt></li>
--   </ul>
skylighting :: Extension


-- | Place this markup in markdown document where you want table of
--   contents to be inserted:
--   
--   <pre>
--   ```toc
--   ```
--   </pre>
--   
--   You may use something different than <tt>"toc"</tt> as the info string
--   of the code block.
module Text.MMark.Extension.TableOfContents

-- | An opaque type representing table of contents produced by the
--   <a>tocScanner</a> scanner.
data Toc

-- | The scanner builds table of contents <a>Toc</a> that can then be
--   passed to <a>toc</a> to obtain an extension that renders the table of
--   contents in HTML.
tocScanner :: (Int -> Bool) -> Fold Bni Toc

-- | Create an extension that replaces a certain code block with previously
--   constructed table of contents.
toc :: Text -> Toc -> Extension


-- | Commonly useful extensions for the MMark markdown processor.
--   
--   We suggest using a qualified import, like this:
--   
--   <pre>
--   import qualified Text.MMark.Extension.Common as Ext
--   </pre>
--   
--   Here is an example that uses several extensions from this module at
--   the same time, it should give you an idea where to start:
--   
--   <pre>
--   {-# LANGUAGE OverloadedStrings #-}
--   
--   module Main (main) where
--   
--   import qualified Data.Text.IO                as T
--   import qualified Data.Text.Lazy.IO           as TL
--   import qualified Lucid                       as L
--   import qualified Text.MMark                  as MMark
--   import qualified Text.MMark.Extension.Common as Ext
--   
--   main :: IO ()
--   main = do
--     let input = "input.md"
--     txt &lt;- T.readFile input
--     case MMark.parse input txt of
--       Left errs -&gt; putStrLn (MMark.parseErrorsPretty txt errs)
--       Right r -&gt;
--         let toc = MMark.runScanner r (Ext.tocScanner (&gt; 1))
--         in TL.writeFile "output.html"
--             . L.renderText
--             . MMark.render
--             . MMark.useExtensions
--                 [ Ext.toc "toc" toc
--                 , Ext.punctuationPrettifier
--                 , Ext.skylighting ]
--             $ r
--   </pre>
module Text.MMark.Extension.Common
