aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Text/BlazeT/Renderer/Text.hs
blob: a595bd164b64fb673fc3d90ce0bba6534d579d10 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{-# LANGUAGE RankNTypes #-}
module Text.BlazeT.Renderer.Text
    ( renderMarkupBuilder
    , renderMarkupBuilderWith
    , renderMarkup
    , renderMarkupWith
    , renderHtmlBuilder
    , renderHtmlBuilderWith
    , renderHtml
    , renderHtmlWith
  ) where

import           Data.ByteString (ByteString)
import           Data.Text (Text)
import qualified Data.Text.Lazy as L
import qualified Data.Text.Lazy.Builder as B
import qualified Text.Blaze.Html.Renderer.Text as BH
import qualified Text.Blaze.Renderer.Text as BU
import           Text.BlazeT

renderMarkupBuilder :: MarkupM a -> B.Builder
renderMarkupBuilder = BU.renderMarkupBuilder . execMarkup

renderHtmlBuilder :: MarkupM a -> B.Builder
renderHtmlBuilder = renderMarkupBuilder

renderMarkup :: MarkupM a -> L.Text
renderMarkup = BU.renderMarkup . execMarkup

renderHtml :: MarkupM a -> L.Text
renderHtml = renderMarkup

renderMarkupWith :: (ByteString -> Text) -> MarkupM a -> L.Text
renderMarkupWith g = (BH.renderHtmlWith g) . execMarkup

renderHtmlWith :: (ByteString -> Text) -> MarkupM a -> L.Text
renderHtmlWith = renderMarkupWith

renderMarkupBuilderWith :: (ByteString -> Text) -> MarkupM a -> B.Builder
renderMarkupBuilderWith g = (BU.renderMarkupBuilderWith g) . execMarkup

renderHtmlBuilderWith :: (ByteString -> Text) -> MarkupM a -> B.Builder
renderHtmlBuilderWith = renderHtmlBuilderWith