{-# LANGUAGE ExtendedDefaultRules #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
module Knit.Report.Input.MarkDown.PandocMarkDown
(
markDownReaderOptions
, addMarkDown
, addMarkDownWithOptions
)
where
import qualified Data.Text as T
import qualified Text.Pandoc as PA
import qualified Polysemy as P
import qualified Knit.Effect.Pandoc as PE
import qualified Knit.Effect.PandocMonad as PM
markDownReaderOptions :: PA.ReaderOptions
markDownReaderOptions = PA.def
{ PA.readerStandalone = True
, PA.readerExtensions = PA.extensionsFromList
[ PA.Ext_auto_identifiers
, PA.Ext_backtick_code_blocks
, PA.Ext_fancy_lists
, PA.Ext_footnotes
, PA.Ext_simple_tables
, PA.Ext_multiline_tables
, PA.Ext_tex_math_dollars
, PA.Ext_header_attributes
, PA.Ext_implicit_header_references
]
}
addMarkDownWithOptions
:: (PM.PandocEffects effs, P.Member PE.ToPandoc effs)
=> PA.ReaderOptions
-> T.Text
-> P.Semantic effs ()
addMarkDownWithOptions = PE.addFrom PE.ReadMarkDown
addMarkDown
:: (PM.PandocEffects effs, P.Member PE.ToPandoc effs)
=> T.Text
-> P.Semantic effs ()
addMarkDown = addMarkDownWithOptions markDownReaderOptions