diff options
Diffstat (limited to 'src/Text/BlazeT/Renderer/Text.hs')
-rw-r--r-- | src/Text/BlazeT/Renderer/Text.hs | 75 |
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 @@ | |||
1 | module 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 | |||
20 | import Control.Monad | ||
21 | import Data.ByteString (ByteString) | ||
22 | import Control.Monad.Identity | ||
23 | import Data.Text (Text) | ||
24 | import qualified Data.Text.Lazy as L | ||
25 | import qualified Data.Text.Lazy.Builder as B | ||
26 | import qualified Text.Blaze.Html.Renderer.Text as BH | ||
27 | import qualified Text.Blaze.Renderer.Text as BU | ||
28 | import Text.BlazeT | ||
29 | |||
30 | renderMarkupBuilder :: MarkupM a -> B.Builder | ||
31 | renderMarkupBuilder = runIdentity . renderMarkupBuilderT | ||
32 | |||
33 | renderMarkupBuilderT :: Monad m => MarkupT m a -> m B.Builder | ||
34 | renderMarkupBuilderT = liftM BU.renderMarkupBuilder . execMarkupT | ||
35 | |||
36 | renderHtmlBuilder :: MarkupM a -> B.Builder | ||
37 | renderHtmlBuilder = renderMarkupBuilder | ||
38 | |||
39 | renderHtmlBuilderT :: Monad m => MarkupT m a -> m B.Builder | ||
40 | renderHtmlBuilderT = renderMarkupBuilderT | ||
41 | |||
42 | renderMarkup :: MarkupM a -> L.Text | ||
43 | renderMarkup = runIdentity . renderMarkupT | ||
44 | renderMarkupT :: Monad m => MarkupT m a -> m L.Text | ||
45 | renderMarkupT = liftM BU.renderMarkup . execMarkupT | ||
46 | |||
47 | renderHtml :: MarkupM a -> L.Text | ||
48 | renderHtml = renderMarkup | ||
49 | renderHtmlT :: Monad m => MarkupT m a -> m L.Text | ||
50 | renderHtmlT = renderMarkupT | ||
51 | |||
52 | renderMarkupWithT :: Monad m => (ByteString -> Text) -> MarkupT m a -> m L.Text | ||
53 | renderMarkupWithT g = liftM (BU.renderMarkupWith g) . execMarkupT | ||
54 | |||
55 | renderMarkupWith :: (ByteString -> Text) -> MarkupM a -> L.Text | ||
56 | renderMarkupWith g = runIdentity . renderMarkupWithT g | ||
57 | |||
58 | renderHtmlWithT :: Monad m => (ByteString -> Text) -> MarkupT m a -> m L.Text | ||
59 | renderHtmlWithT g = liftM (BH.renderHtmlWith g) . execMarkupT | ||
60 | |||
61 | renderHtmlWith :: (ByteString -> Text) -> MarkupM a -> L.Text | ||
62 | renderHtmlWith g = runIdentity . renderHtmlWithT g | ||
63 | |||
64 | renderHtmlBuilderWithT :: Monad m => (ByteString -> Text) -> MarkupT m a -> m B.Builder | ||
65 | renderHtmlBuilderWithT g = liftM (BH.renderHtmlBuilderWith g) . execMarkupT | ||
66 | |||
67 | renderHtmlBuilderWith :: (ByteString -> Text) -> MarkupM a -> B.Builder | ||
68 | renderHtmlBuilderWith g = runIdentity . renderHtmlBuilderWithT g | ||
69 | |||
70 | |||
71 | renderMarkupBuilderWithT :: Monad m => (ByteString -> Text) -> MarkupT m a -> m B.Builder | ||
72 | renderMarkupBuilderWithT g = liftM (BU.renderMarkupBuilderWith g) . execMarkupT | ||
73 | |||
74 | renderMarkupBuilderWith :: (ByteString -> Text) -> MarkupM a -> B.Builder | ||
75 | renderMarkupBuilderWith g = runIdentity . renderMarkupBuilderWithT g | ||