aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Text/BlazeT/Renderer/Text.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/BlazeT/Renderer/Text.hs')
-rw-r--r--src/Text/BlazeT/Renderer/Text.hs75
1 files changed, 75 insertions, 0 deletions
diff --git a/src/Text/BlazeT/Renderer/Text.hs b/src/Text/BlazeT/Renderer/Text.hs
new file mode 100644
index 0000000..31181eb
--- /dev/null
+++ b/src/Text/BlazeT/Renderer/Text.hs
@@ -0,0 +1,75 @@
1module Text.BlazeT.Renderer.Text
2 ( renderMarkupBuilderT
3 , renderMarkupBuilder
4 , renderMarkupBuilderWithT
5 , renderMarkupT
6 , renderMarkupWithT
7 , renderHtmlBuilderT
8 , renderHtmlBuilderWithT
9 , renderHtmlT
10 , renderHtmlWithT
11 , renderMarkupBuilderWith
12 , renderMarkup
13 , renderMarkupWith
14 , renderHtmlBuilder
15 , renderHtmlBuilderWith
16 , renderHtml
17 , renderHtmlWith
18 ) where
19
20import Control.Monad
21import Data.ByteString (ByteString)
22import Control.Monad.Identity
23import Data.Text (Text)
24import qualified Data.Text.Lazy as L
25import qualified Data.Text.Lazy.Builder as B
26import qualified Text.Blaze.Html.Renderer.Text as BH
27import qualified Text.Blaze.Renderer.Text as BU
28import Text.BlazeT
29
30renderMarkupBuilder :: MarkupM a -> B.Builder
31renderMarkupBuilder = runIdentity . renderMarkupBuilderT
32
33renderMarkupBuilderT :: Monad m => MarkupT m a -> m B.Builder
34renderMarkupBuilderT = liftM BU.renderMarkupBuilder . execMarkupT
35
36renderHtmlBuilder :: MarkupM a -> B.Builder
37renderHtmlBuilder = renderMarkupBuilder
38
39renderHtmlBuilderT :: Monad m => MarkupT m a -> m B.Builder
40renderHtmlBuilderT = renderMarkupBuilderT
41
42renderMarkup :: MarkupM a -> L.Text
43renderMarkup = runIdentity . renderMarkupT
44renderMarkupT :: Monad m => MarkupT m a -> m L.Text
45renderMarkupT = liftM BU.renderMarkup . execMarkupT
46
47renderHtml :: MarkupM a -> L.Text
48renderHtml = renderMarkup
49renderHtmlT :: Monad m => MarkupT m a -> m L.Text
50renderHtmlT = renderMarkupT
51
52renderMarkupWithT :: Monad m => (ByteString -> Text) -> MarkupT m a -> m L.Text
53renderMarkupWithT g = liftM (BU.renderMarkupWith g) . execMarkupT
54
55renderMarkupWith :: (ByteString -> Text) -> MarkupM a -> L.Text
56renderMarkupWith g = runIdentity . renderMarkupWithT g
57
58renderHtmlWithT :: Monad m => (ByteString -> Text) -> MarkupT m a -> m L.Text
59renderHtmlWithT g = liftM (BH.renderHtmlWith g) . execMarkupT
60
61renderHtmlWith :: (ByteString -> Text) -> MarkupM a -> L.Text
62renderHtmlWith g = runIdentity . renderHtmlWithT g
63
64renderHtmlBuilderWithT :: Monad m => (ByteString -> Text) -> MarkupT m a -> m B.Builder
65renderHtmlBuilderWithT g = liftM (BH.renderHtmlBuilderWith g) . execMarkupT
66
67renderHtmlBuilderWith :: (ByteString -> Text) -> MarkupM a -> B.Builder
68renderHtmlBuilderWith g = runIdentity . renderHtmlBuilderWithT g
69
70
71renderMarkupBuilderWithT :: Monad m => (ByteString -> Text) -> MarkupT m a -> m B.Builder
72renderMarkupBuilderWithT g = liftM (BU.renderMarkupBuilderWith g) . execMarkupT
73
74renderMarkupBuilderWith :: (ByteString -> Text) -> MarkupM a -> B.Builder
75renderMarkupBuilderWith g = runIdentity . renderMarkupBuilderWithT g