-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | A blazingly fast markup combinator library for Haskell
--   
--   Core modules of a blazingly fast markup combinator library for the
--   Haskell programming language. The Text.Blaze module is a good starting
--   point, as well as this tutorial:
--   http://jaspervdj.be/blaze/tutorial.html.
@package blaze-markup
@version 0.8.3.0

-- | The BlazeMarkup core, consisting of functions that offer the power to
--   generate custom markup elements. It also offers user-centric
--   functions, which are exposed through Text.Blaze.
--   
--   While this module is exported, usage of it is not recommended, unless
--   you know what you are doing. This module might undergo changes at any
--   time.
module Text.Blaze.Internal

-- | A string denoting input from different string representations.
data ChoiceString

-- | Static data
Static :: {-# UNPACK #-} !StaticString -> ChoiceString

-- | A Haskell String
String :: String -> ChoiceString

-- | A Text value
Text :: Text -> ChoiceString

-- | An encoded bytestring
ByteString :: ByteString -> ChoiceString

-- | A pre-escaped string
PreEscaped :: ChoiceString -> ChoiceString

-- | External data in style/script tags, should be checked for validity
External :: ChoiceString -> ChoiceString

-- | Concatenation
AppendChoiceString :: ChoiceString -> ChoiceString -> ChoiceString

-- | Empty string
EmptyChoiceString :: ChoiceString

-- | A static string that supports efficient output to all possible
--   backends.
data StaticString
StaticString :: (String -> String) -> ByteString -> Text -> StaticString

-- | Appending haskell string
[getString] :: StaticString -> String -> String

-- | UTF-8 encoded bytestring
[getUtf8ByteString] :: StaticString -> ByteString

-- | Text value
[getText] :: StaticString -> Text

-- | The core Markup datatype.
data MarkupM a

-- | Tag, open tag, end tag, content
Parent :: StaticString -> StaticString -> StaticString -> MarkupM a -> MarkupM a

-- | Custom parent
CustomParent :: ChoiceString -> MarkupM a -> MarkupM a

-- | Tag, open tag, end tag
Leaf :: StaticString -> StaticString -> StaticString -> a -> MarkupM a

-- | Custom leaf
CustomLeaf :: ChoiceString -> Bool -> a -> MarkupM a

-- | HTML content
Content :: ChoiceString -> a -> MarkupM a

-- | HTML comment. Note: you should wrap the ChoiceString in a
--   PreEscaped.
Comment :: ChoiceString -> a -> MarkupM a

-- | Concatenation of two HTML pieces
Append :: MarkupM b -> MarkupM a -> MarkupM a

-- | Add an attribute to the inner HTML. Raw key, key, value, HTML to
--   receive the attribute.
AddAttribute :: StaticString -> StaticString -> ChoiceString -> MarkupM a -> MarkupM a

-- | Add a custom attribute to the inner HTML.
AddCustomAttribute :: ChoiceString -> ChoiceString -> MarkupM a -> MarkupM a

-- | Empty HTML.
Empty :: a -> MarkupM a

-- | Simplification of the MarkupM datatype.
type Markup = MarkupM ()

-- | Type for an HTML tag. This can be seen as an internal string type used
--   by BlazeMarkup.
data Tag

-- | Type for an attribute.
data Attribute

-- | The type for the value part of an attribute.
data AttributeValue

-- | Create a custom parent element
customParent :: Tag -> Markup -> Markup

-- | Create a custom leaf element
customLeaf :: Tag -> Bool -> Markup

-- | Create an HTML attribute that can be applied to an HTML element later
--   using the ! operator.
attribute :: Tag -> Tag -> AttributeValue -> Attribute

-- | From HTML 5 onwards, the user is able to specify custom data
--   attributes.
--   
--   An example:
--   
--   
--   <p data-foo="bar">Hello.</p>
--   
--   
--   We support this in BlazeMarkup using this function. The above fragment
--   could be described using BlazeMarkup with:
--   
--   
--   p ! dataAttribute "foo" "bar" $ "Hello."
--   
dataAttribute :: Tag -> AttributeValue -> Attribute

-- | Create a custom attribute. This is not specified in the HTML spec, but
--   some JavaScript libraries rely on it.
--   
--   An example:
--   
--   
--   <select dojoType="select">foo</select>
--   
--   
--   Can be produced using:
--   
--   
--   select ! customAttribute "dojoType" "select" $ "foo"
--   
customAttribute :: Tag -> AttributeValue -> Attribute

-- | Render text. Functions like these can be used to supply content in
--   HTML.
text :: Text -> Markup

-- | Render text without escaping.
preEscapedText :: Text -> Markup

-- | A variant of text for lazy Text.
lazyText :: Text -> Markup

-- | A variant of preEscapedText for lazy Text
preEscapedLazyText :: Text -> Markup

-- | A variant of text for text Builder.
textBuilder :: Builder -> Markup

-- | A variant of preEscapedText for lazy Text
preEscapedTextBuilder :: Builder -> Markup

-- | Create an HTML snippet from a String.
string :: String -> Markup

-- | Create an HTML snippet from a String without escaping
preEscapedString :: String -> Markup

-- | Insert a ByteString. This is an unsafe operation:
--   
--   
--   
- The ByteString could have the wrong encoding.
--   
- The ByteString might contain illegal HTML characters (no
--   escaping is done).
--   
unsafeByteString :: ByteString -> Markup

-- | Insert a lazy ByteString. See unsafeByteString for
--   reasons why this is an unsafe operation.
unsafeLazyByteString :: ByteString -> Markup

-- | Create a comment from a Text value. The text should not contain
--   "--". This is not checked by the library.
textComment :: Text -> Markup

-- | Create a comment from a Text value. The text should not contain
--   "--". This is not checked by the library.
lazyTextComment :: Text -> Markup

-- | Create a comment from a String value. The text should not
--   contain "--". This is not checked by the library.
stringComment :: String -> Markup

-- | Create a comment from a ByteString value. The text should not
--   contain "--". This is not checked by the library.
unsafeByteStringComment :: ByteString -> Markup

-- | Create a comment from a ByteString value. The text should not
--   contain "--". This is not checked by the library.
unsafeLazyByteStringComment :: ByteString -> Markup

-- | Create a Tag from some Text.
textTag :: Text -> Tag

-- | Create a Tag from a String.
stringTag :: String -> Tag

-- | Render an attribute value from Text.
textValue :: Text -> AttributeValue

-- | Render an attribute value from Text without escaping.
preEscapedTextValue :: Text -> AttributeValue

-- | A variant of textValue for lazy Text
lazyTextValue :: Text -> AttributeValue

-- | A variant of preEscapedTextValue for lazy Text
preEscapedLazyTextValue :: Text -> AttributeValue

-- | A variant of textValue for text Builder
textBuilderValue :: Builder -> AttributeValue

-- | A variant of preEscapedTextValue for text Builder
preEscapedTextBuilderValue :: Builder -> AttributeValue

-- | Create an attribute value from a String.
stringValue :: String -> AttributeValue

-- | Create an attribute value from a String without escaping.
preEscapedStringValue :: String -> AttributeValue

-- | Create an attribute value from a ByteString. See
--   unsafeByteString for reasons why this might not be a good idea.
unsafeByteStringValue :: ByteString -> AttributeValue

-- | Create an attribute value from a lazy ByteString. See
--   unsafeByteString for reasons why this might not be a good idea.
unsafeLazyByteStringValue :: ByteString -> AttributeValue

-- | Used for applying attributes. You should not define your own instances
--   of this class.
class Attributable h

-- | Apply an attribute to an element.
--   
--   Example:
--   
--   
--   img ! src "foo.png"
--   
--   
--   Result:
--   
--   
--   <img src="foo.png" />
--   
--   
--   This can be used on nested elements as well.
--   
--   Example:
--   
--   
--   p ! style "float: right" $ "Hello!"
--   
--   
--   Result:
--   
--   
--   <p style="float: right">Hello!</p>
--   
(!) :: Attributable h => h -> Attribute -> h

-- | Shorthand for setting an attribute depending on a conditional.
--   
--   Example:
--   
--   
--   p !? (isBig, A.class "big") $ "Hello"
--   
--   
--   Gives the same result as:
--   
--   
--   (if isBig then p ! A.class "big" else p) "Hello"
--   
(!?) :: Attributable h => h -> (Bool, Attribute) -> h

-- | Take only the text content of an HTML tree.
--   
--   
--   contents $ do
--       p ! $ "Hello "
--       p ! $ "Word!"
--   
--   
--   Result:
--   
--   
--   Hello World!
--   
contents :: MarkupM a -> MarkupM a

-- | Mark HTML as external data. External data can be:
--   
--   
--   
- CSS data in a style tag;
--   
- Script data in a script tag.
--   
--   
--   This function is applied automatically when using the style
--   or script combinators.
external :: MarkupM a -> MarkupM a

-- | Check if a Markup value is completely empty (renders to the
--   empty string).
null :: MarkupM a -> Bool
instance GHC.Internal.Base.Applicative Text.Blaze.Internal.MarkupM
instance Text.Blaze.Internal.Attributable (Text.Blaze.Internal.MarkupM a -> Text.Blaze.Internal.MarkupM b)
instance Text.Blaze.Internal.Attributable (Text.Blaze.Internal.MarkupM a)
instance GHC.Internal.Base.Functor Text.Blaze.Internal.MarkupM
instance GHC.Internal.Data.String.IsString Text.Blaze.Internal.AttributeValue
instance GHC.Internal.Data.String.IsString Text.Blaze.Internal.ChoiceString
instance (a GHC.Types.~ ()) => GHC.Internal.Data.String.IsString (Text.Blaze.Internal.MarkupM a)
instance GHC.Internal.Data.String.IsString Text.Blaze.Internal.StaticString
instance GHC.Internal.Data.String.IsString Text.Blaze.Internal.Tag
instance GHC.Internal.Base.Monad Text.Blaze.Internal.MarkupM
instance GHC.Internal.Base.Monoid Text.Blaze.Internal.Attribute
instance GHC.Internal.Base.Monoid Text.Blaze.Internal.AttributeValue
instance GHC.Internal.Base.Monoid Text.Blaze.Internal.ChoiceString
instance GHC.Internal.Base.Monoid a => GHC.Internal.Base.Monoid (Text.Blaze.Internal.MarkupM a)
instance GHC.Internal.Base.Semigroup Text.Blaze.Internal.Attribute
instance GHC.Internal.Base.Semigroup Text.Blaze.Internal.AttributeValue
instance GHC.Internal.Base.Semigroup Text.Blaze.Internal.ChoiceString
instance GHC.Internal.Base.Monoid a => GHC.Internal.Base.Semigroup (Text.Blaze.Internal.MarkupM a)

-- | BlazeMarkup is a markup combinator library. It provides a way to embed
--   markup languages like HTML and SVG in Haskell in an efficient and
--   convenient way, with a light-weight syntax.
--   
--   To use the library, one needs to import a set of combinators. For
--   example, you can use HTML 4 Strict from BlazeHtml package.
--   
--   
--   {-# LANGUAGE OverloadedStrings #-}
--   import Prelude hiding (head, id, div)
--   import Text.Blaze.Html4.Strict hiding (map)
--   import Text.Blaze.Html4.Strict.Attributes hiding (title)
--   
--   
--   To render the page later on, you need a so called Renderer. The
--   recommended renderer is an UTF-8 renderer which produces a lazy
--   bytestring.
--   
--   
--   import Text.Blaze.Renderer.Utf8 (renderMarkup)
--   
--   
--   Now, you can describe pages using the imported combinators.
--   
--   
--   page1 :: Markup
--   page1 = html $ do
--       head $ do
--           title "Introduction page."
--           link ! rel "stylesheet" ! type_ "text/css" ! href "screen.css"
--       body $ do
--           div ! id "header" $ "Syntax"
--           p "This is an example of BlazeMarkup syntax."
--           ul $ mapM_ (li . toMarkup . show) [1, 2, 3]
--   
--   
--   The resulting HTML can now be extracted using:
--   
--   
--   renderMarkup page1
--   
module Text.Blaze

-- | Simplification of the MarkupM datatype.
type Markup = MarkupM ()

-- | Type for an HTML tag. This can be seen as an internal string type used
--   by BlazeMarkup.
data Tag

-- | Type for an attribute.
data Attribute

-- | The type for the value part of an attribute.
data AttributeValue

-- | From HTML 5 onwards, the user is able to specify custom data
--   attributes.
--   
--   An example:
--   
--   
--   <p data-foo="bar">Hello.</p>
--   
--   
--   We support this in BlazeMarkup using this function. The above fragment
--   could be described using BlazeMarkup with:
--   
--   
--   p ! dataAttribute "foo" "bar" $ "Hello."
--   
dataAttribute :: Tag -> AttributeValue -> Attribute

-- | Create a custom attribute. This is not specified in the HTML spec, but
--   some JavaScript libraries rely on it.
--   
--   An example:
--   
--   
--   <select dojoType="select">foo</select>
--   
--   
--   Can be produced using:
--   
--   
--   select ! customAttribute "dojoType" "select" $ "foo"
--   
customAttribute :: Tag -> AttributeValue -> Attribute

-- | Class allowing us to use a single function for Markup values
class ToMarkup a

-- | Convert a value to Markup.
toMarkup :: ToMarkup a => a -> Markup

-- | Convert a value to Markup without escaping
preEscapedToMarkup :: ToMarkup a => a -> Markup

-- | Render text. Functions like these can be used to supply content in
--   HTML.
text :: Text -> Markup

-- | Render text without escaping.
preEscapedText :: Text -> Markup

-- | A variant of text for lazy Text.
lazyText :: Text -> Markup

-- | A variant of preEscapedText for lazy Text
preEscapedLazyText :: Text -> Markup

-- | Create an HTML snippet from a String.
string :: String -> Markup

-- | Create an HTML snippet from a String without escaping
preEscapedString :: String -> Markup

-- | Insert a ByteString. This is an unsafe operation:
--   
--   
--   
- The ByteString could have the wrong encoding.
--   
- The ByteString might contain illegal HTML characters (no
--   escaping is done).
--   
unsafeByteString :: ByteString -> Markup

-- | Insert a lazy ByteString. See unsafeByteString for
--   reasons why this is an unsafe operation.
unsafeLazyByteString :: ByteString -> Markup

-- | Create a comment from a Text value. The text should not contain
--   "--". This is not checked by the library.
textComment :: Text -> Markup

-- | Create a comment from a Text value. The text should not contain
--   "--". This is not checked by the library.
lazyTextComment :: Text -> Markup

-- | Create a comment from a String value. The text should not
--   contain "--". This is not checked by the library.
stringComment :: String -> Markup

-- | Create a comment from a ByteString value. The text should not
--   contain "--". This is not checked by the library.
unsafeByteStringComment :: ByteString -> Markup

-- | Create a comment from a ByteString value. The text should not
--   contain "--". This is not checked by the library.
unsafeLazyByteStringComment :: ByteString -> Markup

-- | Create a Tag from some Text.
textTag :: Text -> Tag

-- | Create a Tag from a String.
stringTag :: String -> Tag

-- | Class allowing us to use a single function for attribute values
class ToValue a

-- | Convert a value to an attribute value
toValue :: ToValue a => a -> AttributeValue

-- | Convert a value to an attribute value without escaping
preEscapedToValue :: ToValue a => a -> AttributeValue

-- | Render an attribute value from Text.
textValue :: Text -> AttributeValue

-- | Render an attribute value from Text without escaping.
preEscapedTextValue :: Text -> AttributeValue

-- | A variant of textValue for lazy Text
lazyTextValue :: Text -> AttributeValue

-- | A variant of preEscapedTextValue for lazy Text
preEscapedLazyTextValue :: Text -> AttributeValue

-- | Create an attribute value from a String.
stringValue :: String -> AttributeValue

-- | Create an attribute value from a String without escaping.
preEscapedStringValue :: String -> AttributeValue

-- | Create an attribute value from a ByteString. See
--   unsafeByteString for reasons why this might not be a good idea.
unsafeByteStringValue :: ByteString -> AttributeValue

-- | Create an attribute value from a lazy ByteString. See
--   unsafeByteString for reasons why this might not be a good idea.
unsafeLazyByteStringValue :: ByteString -> AttributeValue

-- | Apply an attribute to an element.
--   
--   Example:
--   
--   
--   img ! src "foo.png"
--   
--   
--   Result:
--   
--   
--   <img src="foo.png" />
--   
--   
--   This can be used on nested elements as well.
--   
--   Example:
--   
--   
--   p ! style "float: right" $ "Hello!"
--   
--   
--   Result:
--   
--   
--   <p style="float: right">Hello!</p>
--   
(!) :: Attributable h => h -> Attribute -> h

-- | Shorthand for setting an attribute depending on a conditional.
--   
--   Example:
--   
--   
--   p !? (isBig, A.class "big") $ "Hello"
--   
--   
--   Gives the same result as:
--   
--   
--   (if isBig then p ! A.class "big" else p) "Hello"
--   
(!?) :: Attributable h => h -> (Bool, Attribute) -> h

-- | Take only the text content of an HTML tree.
--   
--   
--   contents $ do
--       p ! $ "Hello "
--       p ! $ "Word!"
--   
--   
--   Result:
--   
--   
--   Hello World!
--   
contents :: MarkupM a -> MarkupM a
instance Text.Blaze.ToMarkup GHC.Types.Bool
instance Text.Blaze.ToMarkup Data.Text.Internal.Builder.Builder
instance Text.Blaze.ToMarkup GHC.Types.Char
instance Text.Blaze.ToMarkup GHC.Types.Double
instance Text.Blaze.ToMarkup GHC.Types.Float
instance Text.Blaze.ToMarkup GHC.Types.Int
instance Text.Blaze.ToMarkup GHC.Internal.Int.Int32
instance Text.Blaze.ToMarkup GHC.Internal.Int.Int64
instance Text.Blaze.ToMarkup GHC.Num.Integer.Integer
instance Text.Blaze.ToMarkup [Text.Blaze.Internal.Markup]
instance Text.Blaze.ToMarkup GHC.Internal.Base.String
instance Text.Blaze.ToMarkup Text.Blaze.Internal.Markup
instance Text.Blaze.ToMarkup GHC.Num.Natural.Natural
instance Text.Blaze.ToMarkup (GHC.Internal.Base.NonEmpty GHC.Types.Char)
instance Text.Blaze.ToMarkup Data.Text.Internal.Lazy.Text
instance Text.Blaze.ToMarkup Data.Text.Internal.Text
instance Text.Blaze.ToMarkup GHC.Types.Word
instance Text.Blaze.ToMarkup GHC.Internal.Word.Word32
instance Text.Blaze.ToMarkup GHC.Internal.Word.Word64
instance Text.Blaze.ToValue Text.Blaze.Internal.AttributeValue
instance Text.Blaze.ToValue GHC.Types.Bool
instance Text.Blaze.ToValue Data.Text.Internal.Builder.Builder
instance Text.Blaze.ToValue GHC.Types.Char
instance Text.Blaze.ToValue GHC.Types.Double
instance Text.Blaze.ToValue GHC.Types.Float
instance Text.Blaze.ToValue GHC.Types.Int
instance Text.Blaze.ToValue GHC.Internal.Int.Int32
instance Text.Blaze.ToValue GHC.Internal.Int.Int64
instance Text.Blaze.ToValue GHC.Num.Integer.Integer
instance Text.Blaze.ToValue GHC.Internal.Base.String
instance Text.Blaze.ToValue (GHC.Internal.Base.NonEmpty GHC.Types.Char)
instance Text.Blaze.ToValue Data.Text.Internal.Lazy.Text
instance Text.Blaze.ToValue Data.Text.Internal.Text
instance Text.Blaze.ToValue GHC.Types.Word
instance Text.Blaze.ToValue GHC.Internal.Word.Word32
instance Text.Blaze.ToValue GHC.Internal.Word.Word64

-- | A renderer that produces a native Haskell String, mostly meant
--   for debugging purposes.
module Text.Blaze.Renderer.String

-- | Render a ChoiceString.
fromChoiceString :: ChoiceString -> String -> String

-- | Render markup to a lazy String.
renderMarkup :: Markup -> String

-- | Deprecated: Use renderHtml from Text.Blaze.Html.Renderer.String
--   instead
renderHtml :: Markup -> String

-- | A renderer that produces pretty HTML, mostly meant for debugging
--   purposes.
module Text.Blaze.Renderer.Pretty

-- | Render markup to a lazy String. The result is prettified.
renderMarkup :: Markup -> String

-- | Deprecated: Use renderHtml from Text.Blaze.Html.Renderer.Pretty
--   instead
renderHtml :: Markup -> String

-- | A renderer that produces a lazy Text value, using the Text
--   Builder.
module Text.Blaze.Renderer.Text

-- | Render markup to a text builder
renderMarkupBuilder :: Markup -> Builder

-- | Render some Markup to a Text Builder.
renderMarkupBuilderWith :: (ByteString -> Text) -> Markup -> Builder

-- | Render markup to a lazy Text value. If there are any ByteString's in
--   the input markup, this function will consider them as UTF-8 encoded
--   values and decode them that way.
renderMarkup :: Markup -> Text

-- | Render markup to a lazy Text value. This function allows you to
--   specify what should happen with ByteString's in the input HTML. You
--   can decode them or drop them, this depends on the application...
renderMarkupWith :: (ByteString -> Text) -> Markup -> Text

-- | Deprecated: Use renderHtmlBuilder from
--   Text.Blaze.Html.Renderer.Text instead
renderHtmlBuilder :: Markup -> Builder

-- | Deprecated: Use renderHtmlBuilderWith from
--   Text.Blaze.Html.Renderer.Text instead
renderHtmlBuilderWith :: (ByteString -> Text) -> Markup -> Builder

-- | Deprecated: Use renderHtml from Text.Blaze.Html.Renderer.Text
--   instead
renderHtml :: Markup -> Text

-- | Deprecated: Use renderHtmlWith from Text.Blaze.Html.Renderer.Text
--   instead
renderHtmlWith :: (ByteString -> Text) -> Markup -> Text

module Text.Blaze.Renderer.Utf8

-- | Render some Markup to a Builder.
renderMarkupBuilder :: Markup -> Builder

-- | Render HTML to a lazy UTF-8 encoded 'L.ByteString.'
renderMarkup :: Markup -> ByteString

-- | Repeatedly render HTML to a buffer and process this buffer using the
--   given IO action.
renderMarkupToByteStringIO :: (ByteString -> IO ()) -> Markup -> IO ()

-- | Render some Markup to a Builder.

-- | Deprecated: Use renderHtmlBuilder from
--   Text.Blaze.Html.Renderer.Utf8 instead
renderHtmlBuilder :: Markup -> Builder

-- | Render HTML to a lazy UTF-8 encoded 'L.ByteString.'

-- | Deprecated: Use renderHtml from Text.Blaze.Html.Renderer.Utf8
--   instead
renderHtml :: Markup -> ByteString

-- | Repeatedly render HTML to a buffer and process this buffer using the
--   given IO action.

-- | Deprecated: Use renderMarkupToByteStringIO from
--   Text.Blaze.Html.Renderer.Utf8 instead
renderHtmlToByteStringIO :: (ByteString -> IO ()) -> Markup -> IO ()
