module Text.Pandoc.Builder.Monadic.Veneer
(
div'
, span'
, h1
, h2
, h3
, h4
, h5
, tableWithColspec
, strshow
) where
import Text.Pandoc.Builder.Monadic.Verbatim
( Builder, Inline(..), Block(..), ColSpec, header, simpleTable
, divWith, spanWith, nullAttr, str
)
import Text.Pandoc.Builder.Monadic.Utils
import qualified Data.Text as T
h1 :: Builder Inline -> Builder Block
h1 :: Builder Inline -> Builder Block
h1 = Int -> Builder Inline -> Builder Block
header Int
1
h2 :: Builder Inline -> Builder Block
h2 :: Builder Inline -> Builder Block
h2 = Int -> Builder Inline -> Builder Block
header Int
2
h3 :: Builder Inline -> Builder Block
h3 :: Builder Inline -> Builder Block
h3 = Int -> Builder Inline -> Builder Block
header Int
3
h4 :: Builder Inline -> Builder Block
h4 :: Builder Inline -> Builder Block
h4 = Int -> Builder Inline -> Builder Block
header Int
4
h5 :: Builder Inline -> Builder Block
h5 :: Builder Inline -> Builder Block
h5 = Int -> Builder Inline -> Builder Block
header Int
5
tableWithColspec :: [ColSpec] -> [Builder Block] -> [[Builder Block]] -> Builder Block
tableWithColspec :: [ColSpec] -> [Builder Block] -> [[Builder Block]] -> Builder Block
tableWithColspec [ColSpec]
colspec [Builder Block]
headers [[Builder Block]]
rows = (Block -> Block) -> Builder Block -> Builder Block
forall a b. (a -> b) -> Builder a -> Builder b
mapBuilder Block -> Block
f (Builder Block -> Builder Block) -> Builder Block -> Builder Block
forall a b. (a -> b) -> a -> b
$ [Builder Block] -> [[Builder Block]] -> Builder Block
simpleTable [Builder Block]
headers [[Builder Block]]
rows
where
f :: Block -> Block
f :: Block -> Block
f (Table Attr
attr Caption
caption [ColSpec]
_ TableHead
tableHead [TableBody]
tableBodies TableFoot
tableFoot)
= Attr
-> Caption
-> [ColSpec]
-> TableHead
-> [TableBody]
-> TableFoot
-> Block
Table Attr
attr Caption
caption [ColSpec]
colspec TableHead
tableHead [TableBody]
tableBodies TableFoot
tableFoot
f Block
a = Block
a
div' :: Builder Block -> Builder Block
div' :: Builder Block -> Builder Block
div' = Attr -> Builder Block -> Builder Block
divWith Attr
nullAttr
span' :: Builder Inline -> Builder Inline
span' :: Builder Inline -> Builder Inline
span' = Attr -> Builder Inline -> Builder Inline
spanWith Attr
nullAttr
strshow :: Show a => a -> Builder Inline
strshow :: forall a. Show a => a -> Builder Inline
strshow = Text -> Builder Inline
str (Text -> Builder Inline) -> (a -> Text) -> a -> Builder Inline
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Text
T.pack (String -> Text) -> (a -> String) -> a -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> String
forall a. Show a => a -> String
show