]> git.immae.eu Git - github/fretlink/blazeT.git/blob - src/Text/BlazeT.hs
Docs
[github/fretlink/blazeT.git] / src / Text / BlazeT.hs
1 {-# LANGUAGE UndecidableInstances #-}
2 {-# LANGUAGE FlexibleInstances #-}
3 {-# LANGUAGE RankNTypes #-}
4
5 module Text.BlazeT
6 (
7 -- * DO NOT READ THIS. READ "Text.BlazeT.Internal" INSTEAD
8 -- $descr
9
10 -- * DO NOT READ THIS
11 -- -- * Important types.
12 Markup
13 , Tag
14 , Attribute
15 , AttributeValue
16
17 -- -- * Creating attributes.
18 , dataAttribute
19 , customAttribute
20
21 -- -- * Converting values to Markup.
22 , ToMarkup (..)
23 , text
24 , preEscapedText
25 , lazyText
26 , preEscapedLazyText
27 , string
28 , preEscapedString
29 , unsafeByteString
30 , unsafeLazyByteString
31
32 -- -- * Comments
33 , textComment
34 , lazyTextComment
35 , stringComment
36 , unsafeByteStringComment
37 , unsafeLazyByteStringComment
38
39 -- -- * Creating tags.
40 , textTag
41 , stringTag
42
43 -- -- * Converting values to attribute values.
44 , Text.Blaze.ToValue (..)
45 , textValue
46 , preEscapedTextValue
47 , lazyTextValue
48 , preEscapedLazyTextValue
49 , stringValue
50 , preEscapedStringValue
51 , unsafeByteStringValue
52 , unsafeLazyByteStringValue
53
54 -- -- * Setting attributes
55 , (!)
56 , (!?)
57
58 -- -- * Modifiying Markup trees
59 , contents
60
61 ,MarkupT(..)
62 ,MarkupI
63 ,mapMarkupT
64 ,MarkupM
65 ,Markup2
66 ,runMarkupT
67 ,runMarkup
68 ,runWith
69 ,execMarkupT
70 ,execMarkup
71 ,execWith
72 ) where
73
74 import qualified Text.Blaze
75 import Text.BlazeT.Internal as Text.BlazeT.Internal
76
77 class ToMarkup a where
78 toMarkup :: a -> Markup
79 preEscapedToMarkup :: a -> Markup
80
81 -- test :: (ToMarkup a, Monad m) => a -> MarkupT m ()
82 -- test = toMarkup
83
84 instance Text.Blaze.ToMarkup a => ToMarkup a where
85 toMarkup = wrapMarkup . Text.Blaze.toMarkup
86 {-# INLINE toMarkup #-}
87 preEscapedToMarkup = wrapMarkup . Text.Blaze.preEscapedToMarkup
88 {-# INLINE preEscapedToMarkup #-}
89
90
91 -- $descr
92 --
93 -- Due due a Haddock bug, this documentation is misleading. Please
94 -- read "Text.BlazeT.Internal" instead.
95 --
96 -- (The bug shows both @Text.Blaze.Markup@ and @Text.BlazeT.Markup@ as
97 -- "Markup".)
98 --
99 -- Use this documentation only to see which entities are exported by
100 -- this module.