blaze-html (empty) → 0.1
raw patch · 12 files changed
+7571/−0 lines, 12 filesdep +basedep +bytestringdep +textsetup-changed
Dependencies added: base, bytestring, text
Files
- LICENSE +30/−0
- Setup.hs +3/−0
- blaze-html.cabal +74/−0
- lib/binary-0.5.0.2/src/Data/Binary/Builder.hs +481/−0
- src/Text/Blaze.hs +44/−0
- src/Text/Blaze/Html4/Strict.hs +1255/−0
- src/Text/Blaze/Html4/Strict/Attributes.hs +1452/−0
- src/Text/Blaze/Html5.hs +1684/−0
- src/Text/Blaze/Html5/Attributes.hs +1948/−0
- src/Text/Blaze/Internal.hs +324/−0
- src/Text/Blaze/Internal/Utf8Builder.hs +220/−0
- src/Text/Blaze/Internal/Utf8BuilderHtml.hs +56/−0
+ LICENSE view
@@ -0,0 +1,30 @@+Copyright Jasper Van der Jeugt 2010++All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are met:++ * Redistributions of source code must retain the above copyright+ notice, this list of conditions and the following disclaimer.++ * Redistributions in binary form must reproduce the above+ copyright notice, this list of conditions and the following+ disclaimer in the documentation and/or other materials provided+ with the distribution.++ * Neither the name of Jasper Van der Jeugt nor the names of other+ contributors may be used to endorse or promote products derived+ from this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ Setup.hs view
@@ -0,0 +1,3 @@+#!/usr/bin/env runhaskell+import Distribution.Simple+main = defaultMain
+ blaze-html.cabal view
@@ -0,0 +1,74 @@+-- BlazeHtml.cabal auto-generated by cabal init. For additional+-- options, see+-- http://www.haskell.org/cabal/release/cabal-latest/doc/users-guide/authors.html#pkg-descr.+-- The name of the package.+Name: blaze-html++-- The package version. See the Haskell package versioning policy+-- (http://www.haskell.org/haskellwiki/Package_versioning_policy) for+-- standards guiding when and how versions should be incremented.+Version: 0.1++-- A short (one-line) description of the package.+Synopsis: A blazingly fast HTML generation library.++-- A longer description of the package.+-- Description: ++-- URL for the project homepage or repository.+Homepage: http://jaspervdj.be/blaze+Bug-Reports: http://github.com/jaspervdj/BlazeHtml/issues++-- The license under which the package is released.+License: BSD3++-- The file containing the license text.+License-file: LICENSE++-- The package author(s).+Author: Jasper Van der Jeugt++-- An email address to which users can send suggestions, bug reports,+-- and patches.+Maintainer: jaspervdj@gmail.com++-- A copyright notice.+-- Copyright: ++-- Stability of the pakcage (experimental, provisional, stable...)+Stability: Experimental++Category: Text++Build-type: Simple++-- Extra files to be distributed with the package, such as examples or+-- a README.+-- Extra-source-files: ++-- Constraint on the version of Cabal needed to build this package.+Cabal-version: >=1.2+++Library+ -- Source directories+ Hs-Source-Dirs: src,+ lib/binary-0.5.0.2/src++ -- Modules exported by the library.+ Exposed-modules: Text.Blaze+ Text.Blaze.Html4.Strict+ Text.Blaze.Html4.Strict.Attributes+ Text.Blaze.Html5+ Text.Blaze.Html5.Attributes+ + -- Packages needed in order to build this package.+ Build-depends: base >= 4 && < 5,+ text >= 0.7,+ bytestring >= 0.9+ + -- Modules not exported by this package.+ Other-modules: Data.Binary.Builder+ Text.Blaze.Internal+ Text.Blaze.Internal.Utf8Builder+ Text.Blaze.Internal.Utf8BuilderHtml
+ lib/binary-0.5.0.2/src/Data/Binary/Builder.hs view
@@ -0,0 +1,481 @@+{-# LANGUAGE CPP #-}+{-# OPTIONS_GHC -fglasgow-exts #-}+-- for unboxed shifts++-----------------------------------------------------------------------------+-- |+-- Module : Data.Binary.Builder+-- Copyright : Lennart Kolmodin, Ross Paterson+-- License : BSD3-style (see LICENSE)+-- +-- Maintainer : Lennart Kolmodin <kolmodin@dtek.chalmers.se>+-- Stability : experimental+-- Portability : portable to Hugs and GHC+--+-- Efficient construction of lazy bytestrings.+--+-----------------------------------------------------------------------------++#if defined(__GLASGOW_HASKELL__) && !defined(__HADDOCK__)+#include "MachDeps.h"+#endif++module Data.Binary.Builder (++ -- * The Builder type+ Builder+ , toLazyByteString++ -- * Constructing Builders+ , empty+ , singleton+ , append+ , fromByteString -- :: S.ByteString -> Builder+ , copyByteString -- :: S.ByteString -> Builder+ , fromLazyByteString -- :: L.ByteString -> Builder+ , fromUnsafeWrite+ , fillBuffer+ , forceNewBuffer++ -- * Flushing the buffer state+ , flush++ -- * Derived Builders+ -- ** Big-endian writes+ , putWord16be -- :: Word16 -> Builder+ , putWord32be -- :: Word32 -> Builder+ , putWord64be -- :: Word64 -> Builder++ -- ** Little-endian writes+ , putWord16le -- :: Word16 -> Builder+ , putWord32le -- :: Word32 -> Builder+ , putWord64le -- :: Word64 -> Builder++ -- ** Host-endian, unaligned writes+ , putWordhost -- :: Word -> Builder+ , putWord16host -- :: Word16 -> Builder+ , putWord32host -- :: Word32 -> Builder+ , putWord64host -- :: Word64 -> Builder++ ) where++import Foreign+import Data.Monoid+import Data.Word+import qualified Data.ByteString as S+import qualified Data.ByteString.Lazy as L++import Data.Text (Text)+import qualified Data.Text as T++#ifdef BYTESTRING_IN_BASE+import Data.ByteString.Base (inlinePerformIO)+import qualified Data.ByteString.Base as S+#else+import Data.ByteString.Internal (inlinePerformIO)+import qualified Data.ByteString.Internal as S+import qualified Data.ByteString.Lazy.Internal as L+#endif++#if defined(__GLASGOW_HASKELL__) && !defined(__HADDOCK__)+import GHC.Base+import GHC.Word (Word32(..),Word16(..),Word64(..))++#if WORD_SIZE_IN_BITS < 64 && __GLASGOW_HASKELL__ >= 608+import GHC.Word (uncheckedShiftRL64#)+#endif+#endif++------------------------------------------------------------------------++-- | A 'Builder' is an efficient way to build lazy 'L.ByteString's.+-- There are several functions for constructing 'Builder's, but only one+-- to inspect them: to extract any data, you have to turn them into lazy+-- 'L.ByteString's using 'toLazyByteString'.+--+-- Internally, a 'Builder' constructs a lazy 'L.Bytestring' by filling byte+-- arrays piece by piece. As each buffer is filled, it is \'popped\'+-- off, to become a new chunk of the resulting lazy 'L.ByteString'.+-- All this is hidden from the user of the 'Builder'.++newtype Builder = Builder {+ -- Invariant (from Data.ByteString.Lazy):+ -- The lists include no null ByteStrings.+ runBuilder :: (Buffer -> [S.ByteString]) -> Buffer -> [S.ByteString]+ }++instance Monoid Builder where+ mempty = empty+ {-# INLINE mempty #-}+ mappend = append+ {-# INLINE mappend #-}++------------------------------------------------------------------------++-- | /O(1)./ The empty Builder, satisfying+--+-- * @'toLazyByteString' 'empty' = 'L.empty'@+--+empty :: Builder+empty = Builder id+{-# INLINE empty #-}++-- | /O(1)./ A Builder taking a single byte, satisfying+--+-- * @'toLazyByteString' ('singleton' b) = 'L.singleton' b@+--+singleton :: Word8 -> Builder+singleton = writeN 1 . flip poke+{-# INLINE singleton #-}++------------------------------------------------------------------------++-- | /O(1)./ The concatenation of two Builders, an associative operation+-- with identity 'empty', satisfying+--+-- * @'toLazyByteString' ('append' x y) = 'L.append' ('toLazyByteString' x) ('toLazyByteString' y)@+--+append :: Builder -> Builder -> Builder+append (Builder f) (Builder g) = Builder (f . g)+{-# INLINE append #-}++-- | /O(1)./ A Builder taking a 'S.ByteString', satisfying+--+-- * @'toLazyByteString' ('fromByteString' bs) = 'L.fromChunks' [bs]@+--+fromByteString :: S.ByteString -> Builder+fromByteString bs+ | S.null bs = empty+ | otherwise = flush `append` mapBuilder (bs :)+{-# INLINE fromByteString #-}++-- | Write a 'S.ByteString' to the builder.+--+copyByteString :: S.ByteString -- ^ ByteString to copy+ -> Builder -- ^ Resulting write.+copyByteString byteString = fromUnsafeWrite l f + where+ (fptr, o, l) = S.toForeignPtr byteString+ f dst = do copyBytes dst (unsafeForeignPtrToPtr fptr `plusPtr` o) l+ touchForeignPtr fptr+ {-# INLINE f #-}+{-# INLINE copyByteString #-}+++-- | /O(1)./ A Builder taking a lazy 'L.ByteString', satisfying+--+-- * @'toLazyByteString' ('fromLazyByteString' bs) = bs@+--+fromLazyByteString :: L.ByteString -> Builder+fromLazyByteString bss = flush `append` mapBuilder (L.toChunks bss ++)+{-# INLINE fromLazyByteString #-}++-- | /O(n)./ A Builder from a raw write to a pointer.+fromUnsafeWrite :: Int -- ^ Number of bytes to be written.+ -> (Ptr Word8 -> IO ()) -- ^ Function that does the write.+ -> Builder -- ^ Resulting 'Builder'.+fromUnsafeWrite = writeN+{-# INLINE fromUnsafeWrite #-}++------------------------------------------------------------------------++-- Our internal buffer type+data Buffer = Buffer {-# UNPACK #-} !(ForeignPtr Word8)+ {-# UNPACK #-} !Int -- offset+ {-# UNPACK #-} !Int -- used bytes+ {-# UNPACK #-} !Int -- length left++------------------------------------------------------------------------++-- | /O(n)./ Extract a lazy 'L.ByteString' from a 'Builder'.+-- The construction work takes place if and when the relevant part of+-- the lazy 'L.ByteString' is demanded.+--+toLazyByteString :: Builder -> L.ByteString+toLazyByteString m = L.fromChunks $ unsafePerformIO $ do+ buf <- newBuffer defaultSize+ return (runBuilder (m `append` flush) (const []) buf)++-- | /O(1)./ Pop the 'S.ByteString' we have constructed so far, if any,+-- yielding a new chunk in the result lazy 'L.ByteString'.+flush :: Builder+flush = Builder $ \ k buf@(Buffer p o u l) ->+ if u == 0+ then k buf+ else S.PS p o u : k (Buffer p (o+u) 0 l)++------------------------------------------------------------------------++--+-- copied from Data.ByteString.Lazy+--+defaultSize :: Int+defaultSize = 32 * k - overhead+ where k = 1024+ overhead = 2 * sizeOf (undefined :: Int)++------------------------------------------------------------------------++-- | Sequence an IO operation on the buffer+unsafeLiftIO :: (Buffer -> IO Buffer) -> Builder+unsafeLiftIO f = Builder $ \ k buf -> inlinePerformIO $ do+ buf' <- f buf+ return (k buf')+{-# INLINE unsafeLiftIO #-}++-- | Get the size of the buffer+withSize :: (Int -> Builder) -> Builder+withSize f = Builder $ \ k buf@(Buffer _ _ _ l) ->+ runBuilder (f l) k buf++-- | Map the resulting list of bytestrings.+mapBuilder :: ([S.ByteString] -> [S.ByteString]) -> Builder+mapBuilder f = Builder (f .)++------------------------------------------------------------------------++-- | Ensure that there are at least @n@ many bytes available.+ensureFree :: Int -> Builder+ensureFree n = n `seq` withSize $ \ l ->+ if n <= l then empty else+ flush `append` unsafeLiftIO (const (newBuffer (max n defaultSize)))+{-# INLINE ensureFree #-}++-- | Ensure that @n@ many bytes are available, and then use @f@ to write some+-- bytes into the memory.+writeN :: Int -> (Ptr Word8 -> IO ()) -> Builder+writeN n f = ensureFree n `append` unsafeLiftIO (writeNBuffer n f)+{-# INLINE writeN #-}++writeNBuffer :: Int -> (Ptr Word8 -> IO ()) -> Buffer -> IO Buffer+writeNBuffer n f (Buffer fp o u l) = do+ withForeignPtr fp (\p -> f (p `plusPtr` (o+u)))+ return (Buffer fp o (u+n) (l-n))+{-# INLINE writeNBuffer #-}++newBuffer :: Int -> IO Buffer+newBuffer size = do+ fp <- S.mallocByteString size+ return $! Buffer fp 0 0 size+{-# INLINE newBuffer #-}++-- SM: A function that allows for handing over control flow to the given+-- function. +--+-- The arguments are: length available, ptr to first byte.+-- The results are : the number of written bytes and a builder to be+-- executed for appending the remaining data.+--+-- NOTE: The returned builder must not reference the given Ptr Word8 anymore.+--+-- NOTE: There may be nicer constructions for achieving the same effect. This+-- is just a first hack and I'm not 100% sure that it will always work+-- correctly. That still needs to be verified.+fillBuffer :: (Int -> Ptr Word8 -> IO (Int, Maybe Builder)) -> Builder+fillBuffer f = Builder $ \ k buf@(Buffer fp o u l) -> inlinePerformIO $ do+ (n, next) <- withForeignPtr fp (\p -> f l (p `plusPtr` (o+u)))+ let buf' = Buffer fp o (u+n) (l-n)+ case next of+ Nothing -> return (k buf')+ Just b -> return (runBuilder b k buf')+{-# INLINE fillBuffer #-}++-- | SM: Forces the construction of a new buffer. Currently used in implementations+-- making use of fillBuffer to ensure that a new buffer gets created if no more+-- bytes were free.+forceNewBuffer :: Builder+forceNewBuffer = flush `append` unsafeLiftIO (const (newBuffer defaultSize))+{-# INLINE forceNewBuffer #-}++------------------------------------------------------------------------+-- Aligned, host order writes of storable values++-- | Ensure that @n@ many bytes are available, and then use @f@ to write some+-- storable values into the memory.+writeNbytes :: Storable a => Int -> (Ptr a -> IO ()) -> Builder+writeNbytes n f = ensureFree n `append` unsafeLiftIO (writeNBufferBytes n f)+{-# INLINE writeNbytes #-}++writeNBufferBytes :: Storable a => Int -> (Ptr a -> IO ()) -> Buffer -> IO Buffer+writeNBufferBytes n f (Buffer fp o u l) = do+ withForeignPtr fp (\p -> f (p `plusPtr` (o+u)))+ return (Buffer fp o (u+n) (l-n))+{-# INLINE writeNBufferBytes #-}++------------------------------------------------------------------------++--+-- We rely on the fromIntegral to do the right masking for us.+-- The inlining here is critical, and can be worth 4x performance+--++-- | Write a Word16 in big endian format+putWord16be :: Word16 -> Builder+putWord16be w = writeN 2 $ \p -> do+ poke p (fromIntegral (shiftr_w16 w 8) :: Word8)+ poke (p `plusPtr` 1) (fromIntegral (w) :: Word8)+{-# INLINE putWord16be #-}++-- | Write a Word16 in little endian format+putWord16le :: Word16 -> Builder+putWord16le w = writeN 2 $ \p -> do+ poke p (fromIntegral (w) :: Word8)+ poke (p `plusPtr` 1) (fromIntegral (shiftr_w16 w 8) :: Word8)+{-# INLINE putWord16le #-}++-- putWord16le w16 = writeN 2 (\p -> poke (castPtr p) w16)++-- | Write a Word32 in big endian format+putWord32be :: Word32 -> Builder+putWord32be w = writeN 4 $ \p -> do+ poke p (fromIntegral (shiftr_w32 w 24) :: Word8)+ poke (p `plusPtr` 1) (fromIntegral (shiftr_w32 w 16) :: Word8)+ poke (p `plusPtr` 2) (fromIntegral (shiftr_w32 w 8) :: Word8)+ poke (p `plusPtr` 3) (fromIntegral (w) :: Word8)+{-# INLINE putWord32be #-}++--+-- a data type to tag Put/Check. writes construct these which are then+-- inlined and flattened. matching Checks will be more robust with rules.+--++-- | Write a Word32 in little endian format+putWord32le :: Word32 -> Builder+putWord32le w = writeN 4 $ \p -> do+ poke p (fromIntegral (w) :: Word8)+ poke (p `plusPtr` 1) (fromIntegral (shiftr_w32 w 8) :: Word8)+ poke (p `plusPtr` 2) (fromIntegral (shiftr_w32 w 16) :: Word8)+ poke (p `plusPtr` 3) (fromIntegral (shiftr_w32 w 24) :: Word8)+{-# INLINE putWord32le #-}++-- on a little endian machine:+-- putWord32le w32 = writeN 4 (\p -> poke (castPtr p) w32)++-- | Write a Word64 in big endian format+putWord64be :: Word64 -> Builder+#if WORD_SIZE_IN_BITS < 64+--+-- To avoid expensive 64 bit shifts on 32 bit machines, we cast to+-- Word32, and write that+--+putWord64be w =+ let a = fromIntegral (shiftr_w64 w 32) :: Word32+ b = fromIntegral w :: Word32+ in writeN 8 $ \p -> do+ poke p (fromIntegral (shiftr_w32 a 24) :: Word8)+ poke (p `plusPtr` 1) (fromIntegral (shiftr_w32 a 16) :: Word8)+ poke (p `plusPtr` 2) (fromIntegral (shiftr_w32 a 8) :: Word8)+ poke (p `plusPtr` 3) (fromIntegral (a) :: Word8)+ poke (p `plusPtr` 4) (fromIntegral (shiftr_w32 b 24) :: Word8)+ poke (p `plusPtr` 5) (fromIntegral (shiftr_w32 b 16) :: Word8)+ poke (p `plusPtr` 6) (fromIntegral (shiftr_w32 b 8) :: Word8)+ poke (p `plusPtr` 7) (fromIntegral (b) :: Word8)+#else+putWord64be w = writeN 8 $ \p -> do+ poke p (fromIntegral (shiftr_w64 w 56) :: Word8)+ poke (p `plusPtr` 1) (fromIntegral (shiftr_w64 w 48) :: Word8)+ poke (p `plusPtr` 2) (fromIntegral (shiftr_w64 w 40) :: Word8)+ poke (p `plusPtr` 3) (fromIntegral (shiftr_w64 w 32) :: Word8)+ poke (p `plusPtr` 4) (fromIntegral (shiftr_w64 w 24) :: Word8)+ poke (p `plusPtr` 5) (fromIntegral (shiftr_w64 w 16) :: Word8)+ poke (p `plusPtr` 6) (fromIntegral (shiftr_w64 w 8) :: Word8)+ poke (p `plusPtr` 7) (fromIntegral (w) :: Word8)+#endif+{-# INLINE putWord64be #-}++-- | Write a Word64 in little endian format+putWord64le :: Word64 -> Builder++#if WORD_SIZE_IN_BITS < 64+putWord64le w =+ let b = fromIntegral (shiftr_w64 w 32) :: Word32+ a = fromIntegral w :: Word32+ in writeN 8 $ \p -> do+ poke (p) (fromIntegral (a) :: Word8)+ poke (p `plusPtr` 1) (fromIntegral (shiftr_w32 a 8) :: Word8)+ poke (p `plusPtr` 2) (fromIntegral (shiftr_w32 a 16) :: Word8)+ poke (p `plusPtr` 3) (fromIntegral (shiftr_w32 a 24) :: Word8)+ poke (p `plusPtr` 4) (fromIntegral (b) :: Word8)+ poke (p `plusPtr` 5) (fromIntegral (shiftr_w32 b 8) :: Word8)+ poke (p `plusPtr` 6) (fromIntegral (shiftr_w32 b 16) :: Word8)+ poke (p `plusPtr` 7) (fromIntegral (shiftr_w32 b 24) :: Word8)+#else+putWord64le w = writeN 8 $ \p -> do+ poke p (fromIntegral (w) :: Word8)+ poke (p `plusPtr` 1) (fromIntegral (shiftr_w64 w 8) :: Word8)+ poke (p `plusPtr` 2) (fromIntegral (shiftr_w64 w 16) :: Word8)+ poke (p `plusPtr` 3) (fromIntegral (shiftr_w64 w 24) :: Word8)+ poke (p `plusPtr` 4) (fromIntegral (shiftr_w64 w 32) :: Word8)+ poke (p `plusPtr` 5) (fromIntegral (shiftr_w64 w 40) :: Word8)+ poke (p `plusPtr` 6) (fromIntegral (shiftr_w64 w 48) :: Word8)+ poke (p `plusPtr` 7) (fromIntegral (shiftr_w64 w 56) :: Word8)+#endif+{-# INLINE putWord64le #-}++-- on a little endian machine:+-- putWord64le w64 = writeN 8 (\p -> poke (castPtr p) w64)++------------------------------------------------------------------------+-- Unaligned, word size ops++-- | /O(1)./ A Builder taking a single native machine word. The word is+-- written in host order, host endian form, for the machine you're on.+-- On a 64 bit machine the Word is an 8 byte value, on a 32 bit machine,+-- 4 bytes. Values written this way are not portable to+-- different endian or word sized machines, without conversion.+--+putWordhost :: Word -> Builder+putWordhost w = writeNbytes (sizeOf (undefined :: Word)) (\p -> poke p w)+{-# INLINE putWordhost #-}++-- | Write a Word16 in native host order and host endianness.+-- 2 bytes will be written, unaligned.+putWord16host :: Word16 -> Builder+putWord16host w16 = writeNbytes (sizeOf (undefined :: Word16)) (\p -> poke p w16)+{-# INLINE putWord16host #-}++-- | Write a Word32 in native host order and host endianness.+-- 4 bytes will be written, unaligned.+putWord32host :: Word32 -> Builder+putWord32host w32 = writeNbytes (sizeOf (undefined :: Word32)) (\p -> poke p w32)+{-# INLINE putWord32host #-}++-- | Write a Word64 in native host order.+-- On a 32 bit machine we write two host order Word32s, in big endian form.+-- 8 bytes will be written, unaligned.+putWord64host :: Word64 -> Builder+putWord64host w = writeNbytes (sizeOf (undefined :: Word64)) (\p -> poke p w)+{-# INLINE putWord64host #-}++------------------------------------------------------------------------+-- Unchecked shifts++{-# INLINE shiftr_w16 #-}+shiftr_w16 :: Word16 -> Int -> Word16+{-# INLINE shiftr_w32 #-}+shiftr_w32 :: Word32 -> Int -> Word32+{-# INLINE shiftr_w64 #-}+shiftr_w64 :: Word64 -> Int -> Word64++#if defined(__GLASGOW_HASKELL__) && !defined(__HADDOCK__)+shiftr_w16 (W16# w) (I# i) = W16# (w `uncheckedShiftRL#` i)+shiftr_w32 (W32# w) (I# i) = W32# (w `uncheckedShiftRL#` i)++#if WORD_SIZE_IN_BITS < 64+shiftr_w64 (W64# w) (I# i) = W64# (w `uncheckedShiftRL64#` i)++#if __GLASGOW_HASKELL__ <= 606+-- Exported by GHC.Word in GHC 6.8 and higher+foreign import ccall unsafe "stg_uncheckedShiftRL64"+ uncheckedShiftRL64# :: Word64# -> Int# -> Word64#+#endif++#else+shiftr_w64 (W64# w) (I# i) = W64# (w `uncheckedShiftRL#` i)+#endif++#else+shiftr_w16 = shiftR+shiftr_w32 = shiftR+shiftr_w64 = shiftR+#endif
+ src/Text/Blaze.hs view
@@ -0,0 +1,44 @@+{-# LANGUAGE OverloadedStrings, GeneralizedNewtypeDeriving, Rank2Types,+ FlexibleInstances #-}+-- | Core exposed functions.+--+module Text.Blaze+ (+ -- * Important types.+ Html+ , Tag+ , Attribute+ , AttributeValue++ -- * Creating attributes.+ , dataAttribute++ -- * Converting values to HTML.+ , text+ , preEscapedText+ , string+ , preEscapedString+ , showHtml+ , preEscapedShowHtml++ -- * Inserting literal ByteString's.+ , unsafeByteString++ -- * Creating tags.+ , textTag+ , stringTag++ -- * Converting values to attribute values.+ , textValue+ , preEscapedTextValue+ , stringValue+ , preEscapedStringValue++ -- * Setting attributes+ , (!)++ -- * Rendering HTML.+ , renderHtml+ ) where++import Text.Blaze.Internal
+ src/Text/Blaze/Html4/Strict.hs view
@@ -0,0 +1,1255 @@+{-# LANGUAGE OverloadedStrings #-}+-- | This module exports HTML combinators used to create documents.+--+module Text.Blaze.Html4.Strict+ ( module Text.Blaze+ , html+ , docType+ , a+ , abbr+ , acronym+ , address+ , area+ , b+ , bdo+ , big+ , blockquote+ , body+ , br+ , button+ , caption+ , cite+ , code+ , col+ , colgroup+ , dd+ , del+ , dfn+ , div+ , dl+ , dt+ , em+ , fieldset+ , form+ , h1+ , h2+ , h3+ , h4+ , h5+ , h6+ , head+ , hr+ , htmlNoDocType+ , i+ , img+ , input+ , ins+ , kbd+ , label+ , legend+ , li+ , link+ , map+ , meta+ , noscript+ , object+ , ol+ , optgroup+ , option+ , p+ , param+ , pre+ , q+ , samp+ , script+ , select+ , small+ , span+ , strong+ , style+ , sub+ , sup+ , table+ , tbody+ , td+ , textarea+ , tfoot+ , th+ , thead+ , title+ , tr+ , tt+ , ul+ , var+ ) where++import Prelude ()+import Data.Monoid (mappend)++import Text.Blaze+import Text.Blaze.Internal (parent, leaf, open)++-- | Combinator for the @\<html>@ element. This combinator will also+-- insert the correct doctype.+--+-- Example:+--+-- > html $ span $ text "foo"+--+-- Result:+--+-- > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"+-- > "http://www.w3.org/TR/html4/strict.dtd">+-- > <html><span>foo</span></html>+--+html :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+html inner = docType `mappend` htmlNoDocType inner+{-# INLINE html #-}++-- | Combinator for the document type. This should be placed at the top+-- of every HTML page.+--+-- Example:+--+-- > docType+--+-- Result:+--+-- > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"+-- > "http://www.w3.org/TR/html4/strict.dtd">+--+docType :: Html a -- ^ The document type HTML.+docType = preEscapedText "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\n \"http://www.w3.org/TR/html4/strict.dtd\">\n"+{-# INLINE docType #-}++-- | Combinator for the @\<a>@ element.+--+-- Example:+--+-- > a $ span $ text "foo"+--+-- Result:+--+-- > <a><span>foo</span></a>+--+a :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+a = parent "<a" "</a>"+{-# INLINE a #-}++-- | Combinator for the @\<abbr>@ element.+--+-- Example:+--+-- > abbr $ span $ text "foo"+--+-- Result:+--+-- > <abbr><span>foo</span></abbr>+--+abbr :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+abbr = parent "<abbr" "</abbr>"+{-# INLINE abbr #-}++-- | Combinator for the @\<acronym>@ element.+--+-- Example:+--+-- > acronym $ span $ text "foo"+--+-- Result:+--+-- > <acronym><span>foo</span></acronym>+--+acronym :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+acronym = parent "<acronym" "</acronym>"+{-# INLINE acronym #-}++-- | Combinator for the @\<address>@ element.+--+-- Example:+--+-- > address $ span $ text "foo"+--+-- Result:+--+-- > <address><span>foo</span></address>+--+address :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+address = parent "<address" "</address>"+{-# INLINE address #-}++-- | Combinator for the @\<area>@ element.+--+-- Example:+--+-- > area+--+-- Result:+--+-- > <area>+--+area :: Html a -- ^ Resulting HTML.+area = open "<area"+{-# INLINE area #-}++-- | Combinator for the @\<b>@ element.+--+-- Example:+--+-- > b $ span $ text "foo"+--+-- Result:+--+-- > <b><span>foo</span></b>+--+b :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+b = parent "<b" "</b>"+{-# INLINE b #-}++-- | Combinator for the @\<bdo>@ element.+--+-- Example:+--+-- > bdo $ span $ text "foo"+--+-- Result:+--+-- > <bdo><span>foo</span></bdo>+--+bdo :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+bdo = parent "<bdo" "</bdo>"+{-# INLINE bdo #-}++-- | Combinator for the @\<big>@ element.+--+-- Example:+--+-- > big $ span $ text "foo"+--+-- Result:+--+-- > <big><span>foo</span></big>+--+big :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+big = parent "<big" "</big>"+{-# INLINE big #-}++-- | Combinator for the @\<blockquote>@ element.+--+-- Example:+--+-- > blockquote $ span $ text "foo"+--+-- Result:+--+-- > <blockquote><span>foo</span></blockquote>+--+blockquote :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+blockquote = parent "<blockquote" "</blockquote>"+{-# INLINE blockquote #-}++-- | Combinator for the @\<body>@ element.+--+-- Example:+--+-- > body $ span $ text "foo"+--+-- Result:+--+-- > <body><span>foo</span></body>+--+body :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+body = parent "<body" "</body>"+{-# INLINE body #-}++-- | Combinator for the @\<br>@ element.+--+-- Example:+--+-- > br+--+-- Result:+--+-- > <br>+--+br :: Html a -- ^ Resulting HTML.+br = open "<br"+{-# INLINE br #-}++-- | Combinator for the @\<button>@ element.+--+-- Example:+--+-- > button $ span $ text "foo"+--+-- Result:+--+-- > <button><span>foo</span></button>+--+button :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+button = parent "<button" "</button>"+{-# INLINE button #-}++-- | Combinator for the @\<caption>@ element.+--+-- Example:+--+-- > caption $ span $ text "foo"+--+-- Result:+--+-- > <caption><span>foo</span></caption>+--+caption :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+caption = parent "<caption" "</caption>"+{-# INLINE caption #-}++-- | Combinator for the @\<cite>@ element.+--+-- Example:+--+-- > cite $ span $ text "foo"+--+-- Result:+--+-- > <cite><span>foo</span></cite>+--+cite :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+cite = parent "<cite" "</cite>"+{-# INLINE cite #-}++-- | Combinator for the @\<code>@ element.+--+-- Example:+--+-- > code $ span $ text "foo"+--+-- Result:+--+-- > <code><span>foo</span></code>+--+code :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+code = parent "<code" "</code>"+{-# INLINE code #-}++-- | Combinator for the @\<col>@ element.+--+-- Example:+--+-- > col+--+-- Result:+--+-- > <col>+--+col :: Html a -- ^ Resulting HTML.+col = open "<col"+{-# INLINE col #-}++-- | Combinator for the @\<colgroup>@ element.+--+-- Example:+--+-- > colgroup $ span $ text "foo"+--+-- Result:+--+-- > <colgroup><span>foo</span></colgroup>+--+colgroup :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+colgroup = parent "<colgroup" "</colgroup>"+{-# INLINE colgroup #-}++-- | Combinator for the @\<dd>@ element.+--+-- Example:+--+-- > dd $ span $ text "foo"+--+-- Result:+--+-- > <dd><span>foo</span></dd>+--+dd :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+dd = parent "<dd" "</dd>"+{-# INLINE dd #-}++-- | Combinator for the @\<del>@ element.+--+-- Example:+--+-- > del $ span $ text "foo"+--+-- Result:+--+-- > <del><span>foo</span></del>+--+del :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+del = parent "<del" "</del>"+{-# INLINE del #-}++-- | Combinator for the @\<dfn>@ element.+--+-- Example:+--+-- > dfn $ span $ text "foo"+--+-- Result:+--+-- > <dfn><span>foo</span></dfn>+--+dfn :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+dfn = parent "<dfn" "</dfn>"+{-# INLINE dfn #-}++-- | Combinator for the @\<div>@ element.+--+-- Example:+--+-- > div $ span $ text "foo"+--+-- Result:+--+-- > <div><span>foo</span></div>+--+div :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+div = parent "<div" "</div>"+{-# INLINE div #-}++-- | Combinator for the @\<dl>@ element.+--+-- Example:+--+-- > dl $ span $ text "foo"+--+-- Result:+--+-- > <dl><span>foo</span></dl>+--+dl :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+dl = parent "<dl" "</dl>"+{-# INLINE dl #-}++-- | Combinator for the @\<dt>@ element.+--+-- Example:+--+-- > dt $ span $ text "foo"+--+-- Result:+--+-- > <dt><span>foo</span></dt>+--+dt :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+dt = parent "<dt" "</dt>"+{-# INLINE dt #-}++-- | Combinator for the @\<em>@ element.+--+-- Example:+--+-- > em $ span $ text "foo"+--+-- Result:+--+-- > <em><span>foo</span></em>+--+em :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+em = parent "<em" "</em>"+{-# INLINE em #-}++-- | Combinator for the @\<fieldset>@ element.+--+-- Example:+--+-- > fieldset $ span $ text "foo"+--+-- Result:+--+-- > <fieldset><span>foo</span></fieldset>+--+fieldset :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+fieldset = parent "<fieldset" "</fieldset>"+{-# INLINE fieldset #-}++-- | Combinator for the @\<form>@ element.+--+-- Example:+--+-- > form $ span $ text "foo"+--+-- Result:+--+-- > <form><span>foo</span></form>+--+form :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+form = parent "<form" "</form>"+{-# INLINE form #-}++-- | Combinator for the @\<h1>@ element.+--+-- Example:+--+-- > h1 $ span $ text "foo"+--+-- Result:+--+-- > <h1><span>foo</span></h1>+--+h1 :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+h1 = parent "<h1" "</h1>"+{-# INLINE h1 #-}++-- | Combinator for the @\<h2>@ element.+--+-- Example:+--+-- > h2 $ span $ text "foo"+--+-- Result:+--+-- > <h2><span>foo</span></h2>+--+h2 :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+h2 = parent "<h2" "</h2>"+{-# INLINE h2 #-}++-- | Combinator for the @\<h3>@ element.+--+-- Example:+--+-- > h3 $ span $ text "foo"+--+-- Result:+--+-- > <h3><span>foo</span></h3>+--+h3 :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+h3 = parent "<h3" "</h3>"+{-# INLINE h3 #-}++-- | Combinator for the @\<h4>@ element.+--+-- Example:+--+-- > h4 $ span $ text "foo"+--+-- Result:+--+-- > <h4><span>foo</span></h4>+--+h4 :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+h4 = parent "<h4" "</h4>"+{-# INLINE h4 #-}++-- | Combinator for the @\<h5>@ element.+--+-- Example:+--+-- > h5 $ span $ text "foo"+--+-- Result:+--+-- > <h5><span>foo</span></h5>+--+h5 :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+h5 = parent "<h5" "</h5>"+{-# INLINE h5 #-}++-- | Combinator for the @\<h6>@ element.+--+-- Example:+--+-- > h6 $ span $ text "foo"+--+-- Result:+--+-- > <h6><span>foo</span></h6>+--+h6 :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+h6 = parent "<h6" "</h6>"+{-# INLINE h6 #-}++-- | Combinator for the @\<head>@ element.+--+-- Example:+--+-- > head $ span $ text "foo"+--+-- Result:+--+-- > <head><span>foo</span></head>+--+head :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+head = parent "<head" "</head>"+{-# INLINE head #-}++-- | Combinator for the @\<hr>@ element.+--+-- Example:+--+-- > hr+--+-- Result:+--+-- > <hr>+--+hr :: Html a -- ^ Resulting HTML.+hr = open "<hr"+{-# INLINE hr #-}++-- | Combinator for the @\<html>@ element.+--+-- Example:+--+-- > htmlNoDocType $ span $ text "foo"+--+-- Result:+--+-- > <html><span>foo</span></html>+--+htmlNoDocType :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+htmlNoDocType = parent "<html" "</html>"+{-# INLINE htmlNoDocType #-}++-- | Combinator for the @\<i>@ element.+--+-- Example:+--+-- > i $ span $ text "foo"+--+-- Result:+--+-- > <i><span>foo</span></i>+--+i :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+i = parent "<i" "</i>"+{-# INLINE i #-}++-- | Combinator for the @\<img>@ element.+--+-- Example:+--+-- > img+--+-- Result:+--+-- > <img>+--+img :: Html a -- ^ Resulting HTML.+img = open "<img"+{-# INLINE img #-}++-- | Combinator for the @\<input>@ element.+--+-- Example:+--+-- > input+--+-- Result:+--+-- > <input>+--+input :: Html a -- ^ Resulting HTML.+input = open "<input"+{-# INLINE input #-}++-- | Combinator for the @\<ins>@ element.+--+-- Example:+--+-- > ins $ span $ text "foo"+--+-- Result:+--+-- > <ins><span>foo</span></ins>+--+ins :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+ins = parent "<ins" "</ins>"+{-# INLINE ins #-}++-- | Combinator for the @\<kbd>@ element.+--+-- Example:+--+-- > kbd $ span $ text "foo"+--+-- Result:+--+-- > <kbd><span>foo</span></kbd>+--+kbd :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+kbd = parent "<kbd" "</kbd>"+{-# INLINE kbd #-}++-- | Combinator for the @\<label>@ element.+--+-- Example:+--+-- > label $ span $ text "foo"+--+-- Result:+--+-- > <label><span>foo</span></label>+--+label :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+label = parent "<label" "</label>"+{-# INLINE label #-}++-- | Combinator for the @\<legend>@ element.+--+-- Example:+--+-- > legend $ span $ text "foo"+--+-- Result:+--+-- > <legend><span>foo</span></legend>+--+legend :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+legend = parent "<legend" "</legend>"+{-# INLINE legend #-}++-- | Combinator for the @\<li>@ element.+--+-- Example:+--+-- > li $ span $ text "foo"+--+-- Result:+--+-- > <li><span>foo</span></li>+--+li :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+li = parent "<li" "</li>"+{-# INLINE li #-}++-- | Combinator for the @\<link>@ element.+--+-- Example:+--+-- > link+--+-- Result:+--+-- > <link>+--+link :: Html a -- ^ Resulting HTML.+link = open "<link"+{-# INLINE link #-}++-- | Combinator for the @\<map>@ element.+--+-- Example:+--+-- > map $ span $ text "foo"+--+-- Result:+--+-- > <map><span>foo</span></map>+--+map :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+map = parent "<map" "</map>"+{-# INLINE map #-}++-- | Combinator for the @\<meta>@ element.+--+-- Example:+--+-- > meta+--+-- Result:+--+-- > <meta>+--+meta :: Html a -- ^ Resulting HTML.+meta = open "<meta"+{-# INLINE meta #-}++-- | Combinator for the @\<noscript>@ element.+--+-- Example:+--+-- > noscript $ span $ text "foo"+--+-- Result:+--+-- > <noscript><span>foo</span></noscript>+--+noscript :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+noscript = parent "<noscript" "</noscript>"+{-# INLINE noscript #-}++-- | Combinator for the @\<object>@ element.+--+-- Example:+--+-- > object $ span $ text "foo"+--+-- Result:+--+-- > <object><span>foo</span></object>+--+object :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+object = parent "<object" "</object>"+{-# INLINE object #-}++-- | Combinator for the @\<ol>@ element.+--+-- Example:+--+-- > ol $ span $ text "foo"+--+-- Result:+--+-- > <ol><span>foo</span></ol>+--+ol :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+ol = parent "<ol" "</ol>"+{-# INLINE ol #-}++-- | Combinator for the @\<optgroup>@ element.+--+-- Example:+--+-- > optgroup $ span $ text "foo"+--+-- Result:+--+-- > <optgroup><span>foo</span></optgroup>+--+optgroup :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+optgroup = parent "<optgroup" "</optgroup>"+{-# INLINE optgroup #-}++-- | Combinator for the @\<option>@ element.+--+-- Example:+--+-- > option $ span $ text "foo"+--+-- Result:+--+-- > <option><span>foo</span></option>+--+option :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+option = parent "<option" "</option>"+{-# INLINE option #-}++-- | Combinator for the @\<p>@ element.+--+-- Example:+--+-- > p $ span $ text "foo"+--+-- Result:+--+-- > <p><span>foo</span></p>+--+p :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+p = parent "<p" "</p>"+{-# INLINE p #-}++-- | Combinator for the @\<param>@ element.+--+-- Example:+--+-- > param+--+-- Result:+--+-- > <param>+--+param :: Html a -- ^ Resulting HTML.+param = open "<param"+{-# INLINE param #-}++-- | Combinator for the @\<pre>@ element.+--+-- Example:+--+-- > pre $ span $ text "foo"+--+-- Result:+--+-- > <pre><span>foo</span></pre>+--+pre :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+pre = parent "<pre" "</pre>"+{-# INLINE pre #-}++-- | Combinator for the @\<q>@ element.+--+-- Example:+--+-- > q $ span $ text "foo"+--+-- Result:+--+-- > <q><span>foo</span></q>+--+q :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+q = parent "<q" "</q>"+{-# INLINE q #-}++-- | Combinator for the @\<samp>@ element.+--+-- Example:+--+-- > samp $ span $ text "foo"+--+-- Result:+--+-- > <samp><span>foo</span></samp>+--+samp :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+samp = parent "<samp" "</samp>"+{-# INLINE samp #-}++-- | Combinator for the @\<script>@ element.+--+-- Example:+--+-- > script $ span $ text "foo"+--+-- Result:+--+-- > <script><span>foo</span></script>+--+script :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+script = parent "<script" "</script>"+{-# INLINE script #-}++-- | Combinator for the @\<select>@ element.+--+-- Example:+--+-- > select $ span $ text "foo"+--+-- Result:+--+-- > <select><span>foo</span></select>+--+select :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+select = parent "<select" "</select>"+{-# INLINE select #-}++-- | Combinator for the @\<small>@ element.+--+-- Example:+--+-- > small $ span $ text "foo"+--+-- Result:+--+-- > <small><span>foo</span></small>+--+small :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+small = parent "<small" "</small>"+{-# INLINE small #-}++-- | Combinator for the @\<span>@ element.+--+-- Example:+--+-- > span $ span $ text "foo"+--+-- Result:+--+-- > <span><span>foo</span></span>+--+span :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+span = parent "<span" "</span>"+{-# INLINE span #-}++-- | Combinator for the @\<strong>@ element.+--+-- Example:+--+-- > strong $ span $ text "foo"+--+-- Result:+--+-- > <strong><span>foo</span></strong>+--+strong :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+strong = parent "<strong" "</strong>"+{-# INLINE strong #-}++-- | Combinator for the @\<style>@ element.+--+-- Example:+--+-- > style $ span $ text "foo"+--+-- Result:+--+-- > <style><span>foo</span></style>+--+style :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+style = parent "<style" "</style>"+{-# INLINE style #-}++-- | Combinator for the @\<sub>@ element.+--+-- Example:+--+-- > sub $ span $ text "foo"+--+-- Result:+--+-- > <sub><span>foo</span></sub>+--+sub :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+sub = parent "<sub" "</sub>"+{-# INLINE sub #-}++-- | Combinator for the @\<sup>@ element.+--+-- Example:+--+-- > sup $ span $ text "foo"+--+-- Result:+--+-- > <sup><span>foo</span></sup>+--+sup :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+sup = parent "<sup" "</sup>"+{-# INLINE sup #-}++-- | Combinator for the @\<table>@ element.+--+-- Example:+--+-- > table $ span $ text "foo"+--+-- Result:+--+-- > <table><span>foo</span></table>+--+table :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+table = parent "<table" "</table>"+{-# INLINE table #-}++-- | Combinator for the @\<tbody>@ element.+--+-- Example:+--+-- > tbody $ span $ text "foo"+--+-- Result:+--+-- > <tbody><span>foo</span></tbody>+--+tbody :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+tbody = parent "<tbody" "</tbody>"+{-# INLINE tbody #-}++-- | Combinator for the @\<td>@ element.+--+-- Example:+--+-- > td $ span $ text "foo"+--+-- Result:+--+-- > <td><span>foo</span></td>+--+td :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+td = parent "<td" "</td>"+{-# INLINE td #-}++-- | Combinator for the @\<textarea>@ element.+--+-- Example:+--+-- > textarea $ span $ text "foo"+--+-- Result:+--+-- > <textarea><span>foo</span></textarea>+--+textarea :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+textarea = parent "<textarea" "</textarea>"+{-# INLINE textarea #-}++-- | Combinator for the @\<tfoot>@ element.+--+-- Example:+--+-- > tfoot $ span $ text "foo"+--+-- Result:+--+-- > <tfoot><span>foo</span></tfoot>+--+tfoot :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+tfoot = parent "<tfoot" "</tfoot>"+{-# INLINE tfoot #-}++-- | Combinator for the @\<th>@ element.+--+-- Example:+--+-- > th $ span $ text "foo"+--+-- Result:+--+-- > <th><span>foo</span></th>+--+th :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+th = parent "<th" "</th>"+{-# INLINE th #-}++-- | Combinator for the @\<thead>@ element.+--+-- Example:+--+-- > thead $ span $ text "foo"+--+-- Result:+--+-- > <thead><span>foo</span></thead>+--+thead :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+thead = parent "<thead" "</thead>"+{-# INLINE thead #-}++-- | Combinator for the @\<title>@ element.+--+-- Example:+--+-- > title $ span $ text "foo"+--+-- Result:+--+-- > <title><span>foo</span></title>+--+title :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+title = parent "<title" "</title>"+{-# INLINE title #-}++-- | Combinator for the @\<tr>@ element.+--+-- Example:+--+-- > tr $ span $ text "foo"+--+-- Result:+--+-- > <tr><span>foo</span></tr>+--+tr :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+tr = parent "<tr" "</tr>"+{-# INLINE tr #-}++-- | Combinator for the @\<tt>@ element.+--+-- Example:+--+-- > tt $ span $ text "foo"+--+-- Result:+--+-- > <tt><span>foo</span></tt>+--+tt :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+tt = parent "<tt" "</tt>"+{-# INLINE tt #-}++-- | Combinator for the @\<ul>@ element.+--+-- Example:+--+-- > ul $ span $ text "foo"+--+-- Result:+--+-- > <ul><span>foo</span></ul>+--+ul :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+ul = parent "<ul" "</ul>"+{-# INLINE ul #-}++-- | Combinator for the @\<var>@ element.+--+-- Example:+--+-- > var $ span $ text "foo"+--+-- Result:+--+-- > <var><span>foo</span></var>+--+var :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+var = parent "<var" "</var>"+{-# INLINE var #-}
+ src/Text/Blaze/Html4/Strict/Attributes.hs view
@@ -0,0 +1,1452 @@+{-# LANGUAGE OverloadedStrings #-}+-- | This module exports combinators that provide you with the+-- ability to set attributes on HTML elements.+--+module Text.Blaze.Html4.Strict.Attributes+ ( abbr+ , accept+ , accesskey+ , action+ , align+ , alt+ , archive+ , axis+ , border+ , cellpadding+ , cellspacing+ , char+ , charoff+ , charset+ , checked+ , cite+ , class_+ , classid+ , codebase+ , codetype+ , cols+ , colspan+ , content+ , coords+ , data_+ , datetime+ , declare+ , defer+ , dir+ , disabled+ , for+ , frame+ , headers+ , height+ , href+ , hreflang+ , http_equiv+ , id+ , label+ , lang+ , maxlength+ , media+ , method+ , multiple+ , name+ , nohref+ , onabort+ , onblur+ , onchange+ , onclick+ , ondblclick+ , onfocus+ , onkeydown+ , onkeypress+ , onkeyup+ , onload+ , onmousedown+ , onmousemove+ , onmouseout+ , onmouseover+ , onmouseup+ , onreset+ , onselect+ , onsubmit+ , onunload+ , profile+ , readonly+ , rel+ , rev+ , rows+ , rowspan+ , rules+ , scheme+ , scope+ , selected+ , shape+ , size+ , span+ , src+ , standby+ , style+ , summary+ , tabindex+ , title+ , type_+ , usemap+ , valign+ , value+ , valuetype+ , width+ ) where++import Prelude ()++import Data.Text (Text)++import Text.Blaze.Internal (Attribute, AttributeValue, attribute)++-- | Combinator for the @abbr@ attribute.+--+-- Example:+--+-- > div <! abbr "bar" $ "Hello."+--+-- Result:+--+-- > <div abbr="bar">Hello.</div>+--+abbr :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+abbr = attribute " abbr=\""+{-# INLINE abbr #-}++-- | Combinator for the @accept@ attribute.+--+-- Example:+--+-- > div <! accept "bar" $ "Hello."+--+-- Result:+--+-- > <div accept="bar">Hello.</div>+--+accept :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+accept = attribute " accept=\""+{-# INLINE accept #-}++-- | Combinator for the @accesskey@ attribute.+--+-- Example:+--+-- > div <! accesskey "bar" $ "Hello."+--+-- Result:+--+-- > <div accesskey="bar">Hello.</div>+--+accesskey :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+accesskey = attribute " accesskey=\""+{-# INLINE accesskey #-}++-- | Combinator for the @action@ attribute.+--+-- Example:+--+-- > div <! action "bar" $ "Hello."+--+-- Result:+--+-- > <div action="bar">Hello.</div>+--+action :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+action = attribute " action=\""+{-# INLINE action #-}++-- | Combinator for the @align@ attribute.+--+-- Example:+--+-- > div <! align "bar" $ "Hello."+--+-- Result:+--+-- > <div align="bar">Hello.</div>+--+align :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+align = attribute " align=\""+{-# INLINE align #-}++-- | Combinator for the @alt@ attribute.+--+-- Example:+--+-- > div <! alt "bar" $ "Hello."+--+-- Result:+--+-- > <div alt="bar">Hello.</div>+--+alt :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+alt = attribute " alt=\""+{-# INLINE alt #-}++-- | Combinator for the @archive@ attribute.+--+-- Example:+--+-- > div <! archive "bar" $ "Hello."+--+-- Result:+--+-- > <div archive="bar">Hello.</div>+--+archive :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+archive = attribute " archive=\""+{-# INLINE archive #-}++-- | Combinator for the @axis@ attribute.+--+-- Example:+--+-- > div <! axis "bar" $ "Hello."+--+-- Result:+--+-- > <div axis="bar">Hello.</div>+--+axis :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+axis = attribute " axis=\""+{-# INLINE axis #-}++-- | Combinator for the @border@ attribute.+--+-- Example:+--+-- > div <! border "bar" $ "Hello."+--+-- Result:+--+-- > <div border="bar">Hello.</div>+--+border :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+border = attribute " border=\""+{-# INLINE border #-}++-- | Combinator for the @cellpadding@ attribute.+--+-- Example:+--+-- > div <! cellpadding "bar" $ "Hello."+--+-- Result:+--+-- > <div cellpadding="bar">Hello.</div>+--+cellpadding :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+cellpadding = attribute " cellpadding=\""+{-# INLINE cellpadding #-}++-- | Combinator for the @cellspacing@ attribute.+--+-- Example:+--+-- > div <! cellspacing "bar" $ "Hello."+--+-- Result:+--+-- > <div cellspacing="bar">Hello.</div>+--+cellspacing :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+cellspacing = attribute " cellspacing=\""+{-# INLINE cellspacing #-}++-- | Combinator for the @char@ attribute.+--+-- Example:+--+-- > div <! char "bar" $ "Hello."+--+-- Result:+--+-- > <div char="bar">Hello.</div>+--+char :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+char = attribute " char=\""+{-# INLINE char #-}++-- | Combinator for the @charoff@ attribute.+--+-- Example:+--+-- > div <! charoff "bar" $ "Hello."+--+-- Result:+--+-- > <div charoff="bar">Hello.</div>+--+charoff :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+charoff = attribute " charoff=\""+{-# INLINE charoff #-}++-- | Combinator for the @charset@ attribute.+--+-- Example:+--+-- > div <! charset "bar" $ "Hello."+--+-- Result:+--+-- > <div charset="bar">Hello.</div>+--+charset :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+charset = attribute " charset=\""+{-# INLINE charset #-}++-- | Combinator for the @checked@ attribute.+--+-- Example:+--+-- > div <! checked "bar" $ "Hello."+--+-- Result:+--+-- > <div checked="bar">Hello.</div>+--+checked :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+checked = attribute " checked=\""+{-# INLINE checked #-}++-- | Combinator for the @cite@ attribute.+--+-- Example:+--+-- > div <! cite "bar" $ "Hello."+--+-- Result:+--+-- > <div cite="bar">Hello.</div>+--+cite :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+cite = attribute " cite=\""+{-# INLINE cite #-}++-- | Combinator for the @class@ attribute.+--+-- Example:+--+-- > div <! class_ "bar" $ "Hello."+--+-- Result:+--+-- > <div class="bar">Hello.</div>+--+class_ :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+class_ = attribute " class=\""+{-# INLINE class_ #-}++-- | Combinator for the @classid@ attribute.+--+-- Example:+--+-- > div <! classid "bar" $ "Hello."+--+-- Result:+--+-- > <div classid="bar">Hello.</div>+--+classid :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+classid = attribute " classid=\""+{-# INLINE classid #-}++-- | Combinator for the @codebase@ attribute.+--+-- Example:+--+-- > div <! codebase "bar" $ "Hello."+--+-- Result:+--+-- > <div codebase="bar">Hello.</div>+--+codebase :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+codebase = attribute " codebase=\""+{-# INLINE codebase #-}++-- | Combinator for the @codetype@ attribute.+--+-- Example:+--+-- > div <! codetype "bar" $ "Hello."+--+-- Result:+--+-- > <div codetype="bar">Hello.</div>+--+codetype :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+codetype = attribute " codetype=\""+{-# INLINE codetype #-}++-- | Combinator for the @cols@ attribute.+--+-- Example:+--+-- > div <! cols "bar" $ "Hello."+--+-- Result:+--+-- > <div cols="bar">Hello.</div>+--+cols :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+cols = attribute " cols=\""+{-# INLINE cols #-}++-- | Combinator for the @colspan@ attribute.+--+-- Example:+--+-- > div <! colspan "bar" $ "Hello."+--+-- Result:+--+-- > <div colspan="bar">Hello.</div>+--+colspan :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+colspan = attribute " colspan=\""+{-# INLINE colspan #-}++-- | Combinator for the @content@ attribute.+--+-- Example:+--+-- > div <! content "bar" $ "Hello."+--+-- Result:+--+-- > <div content="bar">Hello.</div>+--+content :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+content = attribute " content=\""+{-# INLINE content #-}++-- | Combinator for the @coords@ attribute.+--+-- Example:+--+-- > div <! coords "bar" $ "Hello."+--+-- Result:+--+-- > <div coords="bar">Hello.</div>+--+coords :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+coords = attribute " coords=\""+{-# INLINE coords #-}++-- | Combinator for the @data@ attribute.+--+-- Example:+--+-- > div <! data_ "bar" $ "Hello."+--+-- Result:+--+-- > <div data="bar">Hello.</div>+--+data_ :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+data_ = attribute " data=\""+{-# INLINE data_ #-}++-- | Combinator for the @datetime@ attribute.+--+-- Example:+--+-- > div <! datetime "bar" $ "Hello."+--+-- Result:+--+-- > <div datetime="bar">Hello.</div>+--+datetime :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+datetime = attribute " datetime=\""+{-# INLINE datetime #-}++-- | Combinator for the @declare@ attribute.+--+-- Example:+--+-- > div <! declare "bar" $ "Hello."+--+-- Result:+--+-- > <div declare="bar">Hello.</div>+--+declare :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+declare = attribute " declare=\""+{-# INLINE declare #-}++-- | Combinator for the @defer@ attribute.+--+-- Example:+--+-- > div <! defer "bar" $ "Hello."+--+-- Result:+--+-- > <div defer="bar">Hello.</div>+--+defer :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+defer = attribute " defer=\""+{-# INLINE defer #-}++-- | Combinator for the @dir@ attribute.+--+-- Example:+--+-- > div <! dir "bar" $ "Hello."+--+-- Result:+--+-- > <div dir="bar">Hello.</div>+--+dir :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+dir = attribute " dir=\""+{-# INLINE dir #-}++-- | Combinator for the @disabled@ attribute.+--+-- Example:+--+-- > div <! disabled "bar" $ "Hello."+--+-- Result:+--+-- > <div disabled="bar">Hello.</div>+--+disabled :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+disabled = attribute " disabled=\""+{-# INLINE disabled #-}++-- | Combinator for the @for@ attribute.+--+-- Example:+--+-- > div <! for "bar" $ "Hello."+--+-- Result:+--+-- > <div for="bar">Hello.</div>+--+for :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+for = attribute " for=\""+{-# INLINE for #-}++-- | Combinator for the @frame@ attribute.+--+-- Example:+--+-- > div <! frame "bar" $ "Hello."+--+-- Result:+--+-- > <div frame="bar">Hello.</div>+--+frame :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+frame = attribute " frame=\""+{-# INLINE frame #-}++-- | Combinator for the @headers@ attribute.+--+-- Example:+--+-- > div <! headers "bar" $ "Hello."+--+-- Result:+--+-- > <div headers="bar">Hello.</div>+--+headers :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+headers = attribute " headers=\""+{-# INLINE headers #-}++-- | Combinator for the @height@ attribute.+--+-- Example:+--+-- > div <! height "bar" $ "Hello."+--+-- Result:+--+-- > <div height="bar">Hello.</div>+--+height :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+height = attribute " height=\""+{-# INLINE height #-}++-- | Combinator for the @href@ attribute.+--+-- Example:+--+-- > div <! href "bar" $ "Hello."+--+-- Result:+--+-- > <div href="bar">Hello.</div>+--+href :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+href = attribute " href=\""+{-# INLINE href #-}++-- | Combinator for the @hreflang@ attribute.+--+-- Example:+--+-- > div <! hreflang "bar" $ "Hello."+--+-- Result:+--+-- > <div hreflang="bar">Hello.</div>+--+hreflang :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+hreflang = attribute " hreflang=\""+{-# INLINE hreflang #-}++-- | Combinator for the @http-equiv@ attribute.+--+-- Example:+--+-- > div <! http_equiv "bar" $ "Hello."+--+-- Result:+--+-- > <div http-equiv="bar">Hello.</div>+--+http_equiv :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+http_equiv = attribute " http-equiv=\""+{-# INLINE http_equiv #-}++-- | Combinator for the @id@ attribute.+--+-- Example:+--+-- > div <! id "bar" $ "Hello."+--+-- Result:+--+-- > <div id="bar">Hello.</div>+--+id :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+id = attribute " id=\""+{-# INLINE id #-}++-- | Combinator for the @label@ attribute.+--+-- Example:+--+-- > div <! label "bar" $ "Hello."+--+-- Result:+--+-- > <div label="bar">Hello.</div>+--+label :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+label = attribute " label=\""+{-# INLINE label #-}++-- | Combinator for the @lang@ attribute.+--+-- Example:+--+-- > div <! lang "bar" $ "Hello."+--+-- Result:+--+-- > <div lang="bar">Hello.</div>+--+lang :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+lang = attribute " lang=\""+{-# INLINE lang #-}++-- | Combinator for the @maxlength@ attribute.+--+-- Example:+--+-- > div <! maxlength "bar" $ "Hello."+--+-- Result:+--+-- > <div maxlength="bar">Hello.</div>+--+maxlength :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+maxlength = attribute " maxlength=\""+{-# INLINE maxlength #-}++-- | Combinator for the @media@ attribute.+--+-- Example:+--+-- > div <! media "bar" $ "Hello."+--+-- Result:+--+-- > <div media="bar">Hello.</div>+--+media :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+media = attribute " media=\""+{-# INLINE media #-}++-- | Combinator for the @method@ attribute.+--+-- Example:+--+-- > div <! method "bar" $ "Hello."+--+-- Result:+--+-- > <div method="bar">Hello.</div>+--+method :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+method = attribute " method=\""+{-# INLINE method #-}++-- | Combinator for the @multiple@ attribute.+--+-- Example:+--+-- > div <! multiple "bar" $ "Hello."+--+-- Result:+--+-- > <div multiple="bar">Hello.</div>+--+multiple :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+multiple = attribute " multiple=\""+{-# INLINE multiple #-}++-- | Combinator for the @name@ attribute.+--+-- Example:+--+-- > div <! name "bar" $ "Hello."+--+-- Result:+--+-- > <div name="bar">Hello.</div>+--+name :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+name = attribute " name=\""+{-# INLINE name #-}++-- | Combinator for the @nohref@ attribute.+--+-- Example:+--+-- > div <! nohref "bar" $ "Hello."+--+-- Result:+--+-- > <div nohref="bar">Hello.</div>+--+nohref :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+nohref = attribute " nohref=\""+{-# INLINE nohref #-}++-- | Combinator for the @onabort@ attribute.+--+-- Example:+--+-- > div <! onabort "bar" $ "Hello."+--+-- Result:+--+-- > <div onabort="bar">Hello.</div>+--+onabort :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onabort = attribute " onabort=\""+{-# INLINE onabort #-}++-- | Combinator for the @onblur@ attribute.+--+-- Example:+--+-- > div <! onblur "bar" $ "Hello."+--+-- Result:+--+-- > <div onblur="bar">Hello.</div>+--+onblur :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onblur = attribute " onblur=\""+{-# INLINE onblur #-}++-- | Combinator for the @onchange@ attribute.+--+-- Example:+--+-- > div <! onchange "bar" $ "Hello."+--+-- Result:+--+-- > <div onchange="bar">Hello.</div>+--+onchange :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onchange = attribute " onchange=\""+{-# INLINE onchange #-}++-- | Combinator for the @onclick@ attribute.+--+-- Example:+--+-- > div <! onclick "bar" $ "Hello."+--+-- Result:+--+-- > <div onclick="bar">Hello.</div>+--+onclick :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onclick = attribute " onclick=\""+{-# INLINE onclick #-}++-- | Combinator for the @ondblclick@ attribute.+--+-- Example:+--+-- > div <! ondblclick "bar" $ "Hello."+--+-- Result:+--+-- > <div ondblclick="bar">Hello.</div>+--+ondblclick :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+ondblclick = attribute " ondblclick=\""+{-# INLINE ondblclick #-}++-- | Combinator for the @onfocus@ attribute.+--+-- Example:+--+-- > div <! onfocus "bar" $ "Hello."+--+-- Result:+--+-- > <div onfocus="bar">Hello.</div>+--+onfocus :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onfocus = attribute " onfocus=\""+{-# INLINE onfocus #-}++-- | Combinator for the @onkeydown@ attribute.+--+-- Example:+--+-- > div <! onkeydown "bar" $ "Hello."+--+-- Result:+--+-- > <div onkeydown="bar">Hello.</div>+--+onkeydown :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onkeydown = attribute " onkeydown=\""+{-# INLINE onkeydown #-}++-- | Combinator for the @onkeypress@ attribute.+--+-- Example:+--+-- > div <! onkeypress "bar" $ "Hello."+--+-- Result:+--+-- > <div onkeypress="bar">Hello.</div>+--+onkeypress :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onkeypress = attribute " onkeypress=\""+{-# INLINE onkeypress #-}++-- | Combinator for the @onkeyup@ attribute.+--+-- Example:+--+-- > div <! onkeyup "bar" $ "Hello."+--+-- Result:+--+-- > <div onkeyup="bar">Hello.</div>+--+onkeyup :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onkeyup = attribute " onkeyup=\""+{-# INLINE onkeyup #-}++-- | Combinator for the @onload@ attribute.+--+-- Example:+--+-- > div <! onload "bar" $ "Hello."+--+-- Result:+--+-- > <div onload="bar">Hello.</div>+--+onload :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onload = attribute " onload=\""+{-# INLINE onload #-}++-- | Combinator for the @onmousedown@ attribute.+--+-- Example:+--+-- > div <! onmousedown "bar" $ "Hello."+--+-- Result:+--+-- > <div onmousedown="bar">Hello.</div>+--+onmousedown :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onmousedown = attribute " onmousedown=\""+{-# INLINE onmousedown #-}++-- | Combinator for the @onmousemove@ attribute.+--+-- Example:+--+-- > div <! onmousemove "bar" $ "Hello."+--+-- Result:+--+-- > <div onmousemove="bar">Hello.</div>+--+onmousemove :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onmousemove = attribute " onmousemove=\""+{-# INLINE onmousemove #-}++-- | Combinator for the @onmouseout@ attribute.+--+-- Example:+--+-- > div <! onmouseout "bar" $ "Hello."+--+-- Result:+--+-- > <div onmouseout="bar">Hello.</div>+--+onmouseout :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onmouseout = attribute " onmouseout=\""+{-# INLINE onmouseout #-}++-- | Combinator for the @onmouseover@ attribute.+--+-- Example:+--+-- > div <! onmouseover "bar" $ "Hello."+--+-- Result:+--+-- > <div onmouseover="bar">Hello.</div>+--+onmouseover :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onmouseover = attribute " onmouseover=\""+{-# INLINE onmouseover #-}++-- | Combinator for the @onmouseup@ attribute.+--+-- Example:+--+-- > div <! onmouseup "bar" $ "Hello."+--+-- Result:+--+-- > <div onmouseup="bar">Hello.</div>+--+onmouseup :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onmouseup = attribute " onmouseup=\""+{-# INLINE onmouseup #-}++-- | Combinator for the @onreset@ attribute.+--+-- Example:+--+-- > div <! onreset "bar" $ "Hello."+--+-- Result:+--+-- > <div onreset="bar">Hello.</div>+--+onreset :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onreset = attribute " onreset=\""+{-# INLINE onreset #-}++-- | Combinator for the @onselect@ attribute.+--+-- Example:+--+-- > div <! onselect "bar" $ "Hello."+--+-- Result:+--+-- > <div onselect="bar">Hello.</div>+--+onselect :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onselect = attribute " onselect=\""+{-# INLINE onselect #-}++-- | Combinator for the @onsubmit@ attribute.+--+-- Example:+--+-- > div <! onsubmit "bar" $ "Hello."+--+-- Result:+--+-- > <div onsubmit="bar">Hello.</div>+--+onsubmit :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onsubmit = attribute " onsubmit=\""+{-# INLINE onsubmit #-}++-- | Combinator for the @onunload@ attribute.+--+-- Example:+--+-- > div <! onunload "bar" $ "Hello."+--+-- Result:+--+-- > <div onunload="bar">Hello.</div>+--+onunload :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onunload = attribute " onunload=\""+{-# INLINE onunload #-}++-- | Combinator for the @profile@ attribute.+--+-- Example:+--+-- > div <! profile "bar" $ "Hello."+--+-- Result:+--+-- > <div profile="bar">Hello.</div>+--+profile :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+profile = attribute " profile=\""+{-# INLINE profile #-}++-- | Combinator for the @readonly@ attribute.+--+-- Example:+--+-- > div <! readonly "bar" $ "Hello."+--+-- Result:+--+-- > <div readonly="bar">Hello.</div>+--+readonly :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+readonly = attribute " readonly=\""+{-# INLINE readonly #-}++-- | Combinator for the @rel@ attribute.+--+-- Example:+--+-- > div <! rel "bar" $ "Hello."+--+-- Result:+--+-- > <div rel="bar">Hello.</div>+--+rel :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+rel = attribute " rel=\""+{-# INLINE rel #-}++-- | Combinator for the @rev@ attribute.+--+-- Example:+--+-- > div <! rev "bar" $ "Hello."+--+-- Result:+--+-- > <div rev="bar">Hello.</div>+--+rev :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+rev = attribute " rev=\""+{-# INLINE rev #-}++-- | Combinator for the @rows@ attribute.+--+-- Example:+--+-- > div <! rows "bar" $ "Hello."+--+-- Result:+--+-- > <div rows="bar">Hello.</div>+--+rows :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+rows = attribute " rows=\""+{-# INLINE rows #-}++-- | Combinator for the @rowspan@ attribute.+--+-- Example:+--+-- > div <! rowspan "bar" $ "Hello."+--+-- Result:+--+-- > <div rowspan="bar">Hello.</div>+--+rowspan :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+rowspan = attribute " rowspan=\""+{-# INLINE rowspan #-}++-- | Combinator for the @rules@ attribute.+--+-- Example:+--+-- > div <! rules "bar" $ "Hello."+--+-- Result:+--+-- > <div rules="bar">Hello.</div>+--+rules :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+rules = attribute " rules=\""+{-# INLINE rules #-}++-- | Combinator for the @scheme@ attribute.+--+-- Example:+--+-- > div <! scheme "bar" $ "Hello."+--+-- Result:+--+-- > <div scheme="bar">Hello.</div>+--+scheme :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+scheme = attribute " scheme=\""+{-# INLINE scheme #-}++-- | Combinator for the @scope@ attribute.+--+-- Example:+--+-- > div <! scope "bar" $ "Hello."+--+-- Result:+--+-- > <div scope="bar">Hello.</div>+--+scope :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+scope = attribute " scope=\""+{-# INLINE scope #-}++-- | Combinator for the @selected@ attribute.+--+-- Example:+--+-- > div <! selected "bar" $ "Hello."+--+-- Result:+--+-- > <div selected="bar">Hello.</div>+--+selected :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+selected = attribute " selected=\""+{-# INLINE selected #-}++-- | Combinator for the @shape@ attribute.+--+-- Example:+--+-- > div <! shape "bar" $ "Hello."+--+-- Result:+--+-- > <div shape="bar">Hello.</div>+--+shape :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+shape = attribute " shape=\""+{-# INLINE shape #-}++-- | Combinator for the @size@ attribute.+--+-- Example:+--+-- > div <! size "bar" $ "Hello."+--+-- Result:+--+-- > <div size="bar">Hello.</div>+--+size :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+size = attribute " size=\""+{-# INLINE size #-}++-- | Combinator for the @span@ attribute.+--+-- Example:+--+-- > div <! span "bar" $ "Hello."+--+-- Result:+--+-- > <div span="bar">Hello.</div>+--+span :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+span = attribute " span=\""+{-# INLINE span #-}++-- | Combinator for the @src@ attribute.+--+-- Example:+--+-- > div <! src "bar" $ "Hello."+--+-- Result:+--+-- > <div src="bar">Hello.</div>+--+src :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+src = attribute " src=\""+{-# INLINE src #-}++-- | Combinator for the @standby@ attribute.+--+-- Example:+--+-- > div <! standby "bar" $ "Hello."+--+-- Result:+--+-- > <div standby="bar">Hello.</div>+--+standby :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+standby = attribute " standby=\""+{-# INLINE standby #-}++-- | Combinator for the @style@ attribute.+--+-- Example:+--+-- > div <! style "bar" $ "Hello."+--+-- Result:+--+-- > <div style="bar">Hello.</div>+--+style :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+style = attribute " style=\""+{-# INLINE style #-}++-- | Combinator for the @summary@ attribute.+--+-- Example:+--+-- > div <! summary "bar" $ "Hello."+--+-- Result:+--+-- > <div summary="bar">Hello.</div>+--+summary :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+summary = attribute " summary=\""+{-# INLINE summary #-}++-- | Combinator for the @tabindex@ attribute.+--+-- Example:+--+-- > div <! tabindex "bar" $ "Hello."+--+-- Result:+--+-- > <div tabindex="bar">Hello.</div>+--+tabindex :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+tabindex = attribute " tabindex=\""+{-# INLINE tabindex #-}++-- | Combinator for the @title@ attribute.+--+-- Example:+--+-- > div <! title "bar" $ "Hello."+--+-- Result:+--+-- > <div title="bar">Hello.</div>+--+title :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+title = attribute " title=\""+{-# INLINE title #-}++-- | Combinator for the @type@ attribute.+--+-- Example:+--+-- > div <! type_ "bar" $ "Hello."+--+-- Result:+--+-- > <div type="bar">Hello.</div>+--+type_ :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+type_ = attribute " type=\""+{-# INLINE type_ #-}++-- | Combinator for the @usemap@ attribute.+--+-- Example:+--+-- > div <! usemap "bar" $ "Hello."+--+-- Result:+--+-- > <div usemap="bar">Hello.</div>+--+usemap :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+usemap = attribute " usemap=\""+{-# INLINE usemap #-}++-- | Combinator for the @valign@ attribute.+--+-- Example:+--+-- > div <! valign "bar" $ "Hello."+--+-- Result:+--+-- > <div valign="bar">Hello.</div>+--+valign :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+valign = attribute " valign=\""+{-# INLINE valign #-}++-- | Combinator for the @value@ attribute.+--+-- Example:+--+-- > div <! value "bar" $ "Hello."+--+-- Result:+--+-- > <div value="bar">Hello.</div>+--+value :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+value = attribute " value=\""+{-# INLINE value #-}++-- | Combinator for the @valuetype@ attribute.+--+-- Example:+--+-- > div <! valuetype "bar" $ "Hello."+--+-- Result:+--+-- > <div valuetype="bar">Hello.</div>+--+valuetype :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+valuetype = attribute " valuetype=\""+{-# INLINE valuetype #-}++-- | Combinator for the @width@ attribute.+--+-- Example:+--+-- > div <! width "bar" $ "Hello."+--+-- Result:+--+-- > <div width="bar">Hello.</div>+--+width :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+width = attribute " width=\""+{-# INLINE width #-}
+ src/Text/Blaze/Html5.hs view
@@ -0,0 +1,1684 @@+{-# LANGUAGE OverloadedStrings #-}+-- | This module exports HTML combinators used to create documents.+--+module Text.Blaze.Html5+ ( module Text.Blaze+ , html+ , docType+ , a+ , abbr+ , address+ , area+ , article+ , aside+ , audio+ , b+ , base+ , bdo+ , blockquote+ , body+ , br+ , button+ , canvas+ , caption+ , cite+ , code+ , col+ , colgroup+ , command+ , datalist+ , dd+ , del+ , details+ , dfn+ , div+ , dl+ , dt+ , em+ , embed+ , fieldset+ , figcaption+ , figure+ , footer+ , form+ , h1+ , h2+ , h3+ , h4+ , h5+ , h6+ , head+ , header+ , hgroup+ , hr+ , htmlNoDocType+ , i+ , iframe+ , img+ , input+ , ins+ , kbd+ , keygen+ , label+ , legend+ , li+ , link+ , map+ , mark+ , menu+ , meta+ , meter+ , nav+ , noscript+ , object+ , ol+ , optgroup+ , option+ , output+ , p+ , param+ , pre+ , progress+ , q+ , rp+ , rt+ , ruby+ , samp+ , script+ , section+ , select+ , small+ , source+ , span+ , strong+ , style+ , sub+ , summary+ , sup+ , table+ , tbody+ , td+ , textarea+ , tfoot+ , th+ , thead+ , time+ , title+ , tr+ , ul+ , var+ , video+ ) where++import Prelude ()+import Data.Monoid (mappend)++import Text.Blaze+import Text.Blaze.Internal (parent, leaf, open)++-- | Combinator for the @\<html>@ element. This combinator will also+-- insert the correct doctype.+--+-- Example:+--+-- > html $ span $ text "foo"+--+-- Result:+--+-- > <!DOCTYPE HTML>+-- > <html><span>foo</span></html>+--+html :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+html inner = docType `mappend` htmlNoDocType inner+{-# INLINE html #-}++-- | Combinator for the document type. This should be placed at the top+-- of every HTML page.+--+-- Example:+--+-- > docType+--+-- Result:+--+-- > <!DOCTYPE HTML>+--+docType :: Html a -- ^ The document type HTML.+docType = preEscapedText "<!DOCTYPE HTML>\n"+{-# INLINE docType #-}++-- | Combinator for the @\<a>@ element.+--+-- Example:+--+-- > a $ span $ text "foo"+--+-- Result:+--+-- > <a><span>foo</span></a>+--+a :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+a = parent "<a" "</a>"+{-# INLINE a #-}++-- | Combinator for the @\<abbr>@ element.+--+-- Example:+--+-- > abbr $ span $ text "foo"+--+-- Result:+--+-- > <abbr><span>foo</span></abbr>+--+abbr :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+abbr = parent "<abbr" "</abbr>"+{-# INLINE abbr #-}++-- | Combinator for the @\<address>@ element.+--+-- Example:+--+-- > address $ span $ text "foo"+--+-- Result:+--+-- > <address><span>foo</span></address>+--+address :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+address = parent "<address" "</address>"+{-# INLINE address #-}++-- | Combinator for the @\<area />@ element.+--+-- Example:+--+-- > area+--+-- Result:+--+-- > <area />+--+area :: Html a -- ^ Resulting HTML.+area = leaf "<area"+{-# INLINE area #-}++-- | Combinator for the @\<article>@ element.+--+-- Example:+--+-- > article $ span $ text "foo"+--+-- Result:+--+-- > <article><span>foo</span></article>+--+article :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+article = parent "<article" "</article>"+{-# INLINE article #-}++-- | Combinator for the @\<aside>@ element.+--+-- Example:+--+-- > aside $ span $ text "foo"+--+-- Result:+--+-- > <aside><span>foo</span></aside>+--+aside :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+aside = parent "<aside" "</aside>"+{-# INLINE aside #-}++-- | Combinator for the @\<audio>@ element.+--+-- Example:+--+-- > audio $ span $ text "foo"+--+-- Result:+--+-- > <audio><span>foo</span></audio>+--+audio :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+audio = parent "<audio" "</audio>"+{-# INLINE audio #-}++-- | Combinator for the @\<b>@ element.+--+-- Example:+--+-- > b $ span $ text "foo"+--+-- Result:+--+-- > <b><span>foo</span></b>+--+b :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+b = parent "<b" "</b>"+{-# INLINE b #-}++-- | Combinator for the @\<base>@ element.+--+-- Example:+--+-- > base $ span $ text "foo"+--+-- Result:+--+-- > <base><span>foo</span></base>+--+base :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+base = parent "<base" "</base>"+{-# INLINE base #-}++-- | Combinator for the @\<bdo>@ element.+--+-- Example:+--+-- > bdo $ span $ text "foo"+--+-- Result:+--+-- > <bdo><span>foo</span></bdo>+--+bdo :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+bdo = parent "<bdo" "</bdo>"+{-# INLINE bdo #-}++-- | Combinator for the @\<blockquote>@ element.+--+-- Example:+--+-- > blockquote $ span $ text "foo"+--+-- Result:+--+-- > <blockquote><span>foo</span></blockquote>+--+blockquote :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+blockquote = parent "<blockquote" "</blockquote>"+{-# INLINE blockquote #-}++-- | Combinator for the @\<body>@ element.+--+-- Example:+--+-- > body $ span $ text "foo"+--+-- Result:+--+-- > <body><span>foo</span></body>+--+body :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+body = parent "<body" "</body>"+{-# INLINE body #-}++-- | Combinator for the @\<br />@ element.+--+-- Example:+--+-- > br+--+-- Result:+--+-- > <br />+--+br :: Html a -- ^ Resulting HTML.+br = leaf "<br"+{-# INLINE br #-}++-- | Combinator for the @\<button>@ element.+--+-- Example:+--+-- > button $ span $ text "foo"+--+-- Result:+--+-- > <button><span>foo</span></button>+--+button :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+button = parent "<button" "</button>"+{-# INLINE button #-}++-- | Combinator for the @\<canvas>@ element.+--+-- Example:+--+-- > canvas $ span $ text "foo"+--+-- Result:+--+-- > <canvas><span>foo</span></canvas>+--+canvas :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+canvas = parent "<canvas" "</canvas>"+{-# INLINE canvas #-}++-- | Combinator for the @\<caption>@ element.+--+-- Example:+--+-- > caption $ span $ text "foo"+--+-- Result:+--+-- > <caption><span>foo</span></caption>+--+caption :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+caption = parent "<caption" "</caption>"+{-# INLINE caption #-}++-- | Combinator for the @\<cite>@ element.+--+-- Example:+--+-- > cite $ span $ text "foo"+--+-- Result:+--+-- > <cite><span>foo</span></cite>+--+cite :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+cite = parent "<cite" "</cite>"+{-# INLINE cite #-}++-- | Combinator for the @\<code>@ element.+--+-- Example:+--+-- > code $ span $ text "foo"+--+-- Result:+--+-- > <code><span>foo</span></code>+--+code :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+code = parent "<code" "</code>"+{-# INLINE code #-}++-- | Combinator for the @\<col />@ element.+--+-- Example:+--+-- > col+--+-- Result:+--+-- > <col />+--+col :: Html a -- ^ Resulting HTML.+col = leaf "<col"+{-# INLINE col #-}++-- | Combinator for the @\<colgroup>@ element.+--+-- Example:+--+-- > colgroup $ span $ text "foo"+--+-- Result:+--+-- > <colgroup><span>foo</span></colgroup>+--+colgroup :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+colgroup = parent "<colgroup" "</colgroup>"+{-# INLINE colgroup #-}++-- | Combinator for the @\<command>@ element.+--+-- Example:+--+-- > command $ span $ text "foo"+--+-- Result:+--+-- > <command><span>foo</span></command>+--+command :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+command = parent "<command" "</command>"+{-# INLINE command #-}++-- | Combinator for the @\<datalist>@ element.+--+-- Example:+--+-- > datalist $ span $ text "foo"+--+-- Result:+--+-- > <datalist><span>foo</span></datalist>+--+datalist :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+datalist = parent "<datalist" "</datalist>"+{-# INLINE datalist #-}++-- | Combinator for the @\<dd>@ element.+--+-- Example:+--+-- > dd $ span $ text "foo"+--+-- Result:+--+-- > <dd><span>foo</span></dd>+--+dd :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+dd = parent "<dd" "</dd>"+{-# INLINE dd #-}++-- | Combinator for the @\<del>@ element.+--+-- Example:+--+-- > del $ span $ text "foo"+--+-- Result:+--+-- > <del><span>foo</span></del>+--+del :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+del = parent "<del" "</del>"+{-# INLINE del #-}++-- | Combinator for the @\<details>@ element.+--+-- Example:+--+-- > details $ span $ text "foo"+--+-- Result:+--+-- > <details><span>foo</span></details>+--+details :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+details = parent "<details" "</details>"+{-# INLINE details #-}++-- | Combinator for the @\<dfn>@ element.+--+-- Example:+--+-- > dfn $ span $ text "foo"+--+-- Result:+--+-- > <dfn><span>foo</span></dfn>+--+dfn :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+dfn = parent "<dfn" "</dfn>"+{-# INLINE dfn #-}++-- | Combinator for the @\<div>@ element.+--+-- Example:+--+-- > div $ span $ text "foo"+--+-- Result:+--+-- > <div><span>foo</span></div>+--+div :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+div = parent "<div" "</div>"+{-# INLINE div #-}++-- | Combinator for the @\<dl>@ element.+--+-- Example:+--+-- > dl $ span $ text "foo"+--+-- Result:+--+-- > <dl><span>foo</span></dl>+--+dl :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+dl = parent "<dl" "</dl>"+{-# INLINE dl #-}++-- | Combinator for the @\<dt>@ element.+--+-- Example:+--+-- > dt $ span $ text "foo"+--+-- Result:+--+-- > <dt><span>foo</span></dt>+--+dt :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+dt = parent "<dt" "</dt>"+{-# INLINE dt #-}++-- | Combinator for the @\<em>@ element.+--+-- Example:+--+-- > em $ span $ text "foo"+--+-- Result:+--+-- > <em><span>foo</span></em>+--+em :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+em = parent "<em" "</em>"+{-# INLINE em #-}++-- | Combinator for the @\<embed />@ element.+--+-- Example:+--+-- > embed+--+-- Result:+--+-- > <embed />+--+embed :: Html a -- ^ Resulting HTML.+embed = leaf "<embed"+{-# INLINE embed #-}++-- | Combinator for the @\<fieldset>@ element.+--+-- Example:+--+-- > fieldset $ span $ text "foo"+--+-- Result:+--+-- > <fieldset><span>foo</span></fieldset>+--+fieldset :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+fieldset = parent "<fieldset" "</fieldset>"+{-# INLINE fieldset #-}++-- | Combinator for the @\<figcaption>@ element.+--+-- Example:+--+-- > figcaption $ span $ text "foo"+--+-- Result:+--+-- > <figcaption><span>foo</span></figcaption>+--+figcaption :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+figcaption = parent "<figcaption" "</figcaption>"+{-# INLINE figcaption #-}++-- | Combinator for the @\<figure>@ element.+--+-- Example:+--+-- > figure $ span $ text "foo"+--+-- Result:+--+-- > <figure><span>foo</span></figure>+--+figure :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+figure = parent "<figure" "</figure>"+{-# INLINE figure #-}++-- | Combinator for the @\<footer>@ element.+--+-- Example:+--+-- > footer $ span $ text "foo"+--+-- Result:+--+-- > <footer><span>foo</span></footer>+--+footer :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+footer = parent "<footer" "</footer>"+{-# INLINE footer #-}++-- | Combinator for the @\<form>@ element.+--+-- Example:+--+-- > form $ span $ text "foo"+--+-- Result:+--+-- > <form><span>foo</span></form>+--+form :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+form = parent "<form" "</form>"+{-# INLINE form #-}++-- | Combinator for the @\<h1>@ element.+--+-- Example:+--+-- > h1 $ span $ text "foo"+--+-- Result:+--+-- > <h1><span>foo</span></h1>+--+h1 :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+h1 = parent "<h1" "</h1>"+{-# INLINE h1 #-}++-- | Combinator for the @\<h2>@ element.+--+-- Example:+--+-- > h2 $ span $ text "foo"+--+-- Result:+--+-- > <h2><span>foo</span></h2>+--+h2 :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+h2 = parent "<h2" "</h2>"+{-# INLINE h2 #-}++-- | Combinator for the @\<h3>@ element.+--+-- Example:+--+-- > h3 $ span $ text "foo"+--+-- Result:+--+-- > <h3><span>foo</span></h3>+--+h3 :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+h3 = parent "<h3" "</h3>"+{-# INLINE h3 #-}++-- | Combinator for the @\<h4>@ element.+--+-- Example:+--+-- > h4 $ span $ text "foo"+--+-- Result:+--+-- > <h4><span>foo</span></h4>+--+h4 :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+h4 = parent "<h4" "</h4>"+{-# INLINE h4 #-}++-- | Combinator for the @\<h5>@ element.+--+-- Example:+--+-- > h5 $ span $ text "foo"+--+-- Result:+--+-- > <h5><span>foo</span></h5>+--+h5 :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+h5 = parent "<h5" "</h5>"+{-# INLINE h5 #-}++-- | Combinator for the @\<h6>@ element.+--+-- Example:+--+-- > h6 $ span $ text "foo"+--+-- Result:+--+-- > <h6><span>foo</span></h6>+--+h6 :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+h6 = parent "<h6" "</h6>"+{-# INLINE h6 #-}++-- | Combinator for the @\<head>@ element.+--+-- Example:+--+-- > head $ span $ text "foo"+--+-- Result:+--+-- > <head><span>foo</span></head>+--+head :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+head = parent "<head" "</head>"+{-# INLINE head #-}++-- | Combinator for the @\<header>@ element.+--+-- Example:+--+-- > header $ span $ text "foo"+--+-- Result:+--+-- > <header><span>foo</span></header>+--+header :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+header = parent "<header" "</header>"+{-# INLINE header #-}++-- | Combinator for the @\<hgroup>@ element.+--+-- Example:+--+-- > hgroup $ span $ text "foo"+--+-- Result:+--+-- > <hgroup><span>foo</span></hgroup>+--+hgroup :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+hgroup = parent "<hgroup" "</hgroup>"+{-# INLINE hgroup #-}++-- | Combinator for the @\<hr />@ element.+--+-- Example:+--+-- > hr+--+-- Result:+--+-- > <hr />+--+hr :: Html a -- ^ Resulting HTML.+hr = leaf "<hr"+{-# INLINE hr #-}++-- | Combinator for the @\<html>@ element.+--+-- Example:+--+-- > htmlNoDocType $ span $ text "foo"+--+-- Result:+--+-- > <html><span>foo</span></html>+--+htmlNoDocType :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+htmlNoDocType = parent "<html" "</html>"+{-# INLINE htmlNoDocType #-}++-- | Combinator for the @\<i>@ element.+--+-- Example:+--+-- > i $ span $ text "foo"+--+-- Result:+--+-- > <i><span>foo</span></i>+--+i :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+i = parent "<i" "</i>"+{-# INLINE i #-}++-- | Combinator for the @\<iframe>@ element.+--+-- Example:+--+-- > iframe $ span $ text "foo"+--+-- Result:+--+-- > <iframe><span>foo</span></iframe>+--+iframe :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+iframe = parent "<iframe" "</iframe>"+{-# INLINE iframe #-}++-- | Combinator for the @\<img />@ element.+--+-- Example:+--+-- > img+--+-- Result:+--+-- > <img />+--+img :: Html a -- ^ Resulting HTML.+img = leaf "<img"+{-# INLINE img #-}++-- | Combinator for the @\<input />@ element.+--+-- Example:+--+-- > input+--+-- Result:+--+-- > <input />+--+input :: Html a -- ^ Resulting HTML.+input = leaf "<input"+{-# INLINE input #-}++-- | Combinator for the @\<ins>@ element.+--+-- Example:+--+-- > ins $ span $ text "foo"+--+-- Result:+--+-- > <ins><span>foo</span></ins>+--+ins :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+ins = parent "<ins" "</ins>"+{-# INLINE ins #-}++-- | Combinator for the @\<kbd>@ element.+--+-- Example:+--+-- > kbd $ span $ text "foo"+--+-- Result:+--+-- > <kbd><span>foo</span></kbd>+--+kbd :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+kbd = parent "<kbd" "</kbd>"+{-# INLINE kbd #-}++-- | Combinator for the @\<keygen>@ element.+--+-- Example:+--+-- > keygen $ span $ text "foo"+--+-- Result:+--+-- > <keygen><span>foo</span></keygen>+--+keygen :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+keygen = parent "<keygen" "</keygen>"+{-# INLINE keygen #-}++-- | Combinator for the @\<label>@ element.+--+-- Example:+--+-- > label $ span $ text "foo"+--+-- Result:+--+-- > <label><span>foo</span></label>+--+label :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+label = parent "<label" "</label>"+{-# INLINE label #-}++-- | Combinator for the @\<legend>@ element.+--+-- Example:+--+-- > legend $ span $ text "foo"+--+-- Result:+--+-- > <legend><span>foo</span></legend>+--+legend :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+legend = parent "<legend" "</legend>"+{-# INLINE legend #-}++-- | Combinator for the @\<li>@ element.+--+-- Example:+--+-- > li $ span $ text "foo"+--+-- Result:+--+-- > <li><span>foo</span></li>+--+li :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+li = parent "<li" "</li>"+{-# INLINE li #-}++-- | Combinator for the @\<link />@ element.+--+-- Example:+--+-- > link+--+-- Result:+--+-- > <link />+--+link :: Html a -- ^ Resulting HTML.+link = leaf "<link"+{-# INLINE link #-}++-- | Combinator for the @\<map>@ element.+--+-- Example:+--+-- > map $ span $ text "foo"+--+-- Result:+--+-- > <map><span>foo</span></map>+--+map :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+map = parent "<map" "</map>"+{-# INLINE map #-}++-- | Combinator for the @\<mark>@ element.+--+-- Example:+--+-- > mark $ span $ text "foo"+--+-- Result:+--+-- > <mark><span>foo</span></mark>+--+mark :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+mark = parent "<mark" "</mark>"+{-# INLINE mark #-}++-- | Combinator for the @\<menu>@ element.+--+-- Example:+--+-- > menu $ span $ text "foo"+--+-- Result:+--+-- > <menu><span>foo</span></menu>+--+menu :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+menu = parent "<menu" "</menu>"+{-# INLINE menu #-}++-- | Combinator for the @\<meta />@ element.+--+-- Example:+--+-- > meta+--+-- Result:+--+-- > <meta />+--+meta :: Html a -- ^ Resulting HTML.+meta = leaf "<meta"+{-# INLINE meta #-}++-- | Combinator for the @\<meter>@ element.+--+-- Example:+--+-- > meter $ span $ text "foo"+--+-- Result:+--+-- > <meter><span>foo</span></meter>+--+meter :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+meter = parent "<meter" "</meter>"+{-# INLINE meter #-}++-- | Combinator for the @\<nav>@ element.+--+-- Example:+--+-- > nav $ span $ text "foo"+--+-- Result:+--+-- > <nav><span>foo</span></nav>+--+nav :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+nav = parent "<nav" "</nav>"+{-# INLINE nav #-}++-- | Combinator for the @\<noscript>@ element.+--+-- Example:+--+-- > noscript $ span $ text "foo"+--+-- Result:+--+-- > <noscript><span>foo</span></noscript>+--+noscript :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+noscript = parent "<noscript" "</noscript>"+{-# INLINE noscript #-}++-- | Combinator for the @\<object>@ element.+--+-- Example:+--+-- > object $ span $ text "foo"+--+-- Result:+--+-- > <object><span>foo</span></object>+--+object :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+object = parent "<object" "</object>"+{-# INLINE object #-}++-- | Combinator for the @\<ol>@ element.+--+-- Example:+--+-- > ol $ span $ text "foo"+--+-- Result:+--+-- > <ol><span>foo</span></ol>+--+ol :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+ol = parent "<ol" "</ol>"+{-# INLINE ol #-}++-- | Combinator for the @\<optgroup>@ element.+--+-- Example:+--+-- > optgroup $ span $ text "foo"+--+-- Result:+--+-- > <optgroup><span>foo</span></optgroup>+--+optgroup :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+optgroup = parent "<optgroup" "</optgroup>"+{-# INLINE optgroup #-}++-- | Combinator for the @\<option>@ element.+--+-- Example:+--+-- > option $ span $ text "foo"+--+-- Result:+--+-- > <option><span>foo</span></option>+--+option :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+option = parent "<option" "</option>"+{-# INLINE option #-}++-- | Combinator for the @\<output>@ element.+--+-- Example:+--+-- > output $ span $ text "foo"+--+-- Result:+--+-- > <output><span>foo</span></output>+--+output :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+output = parent "<output" "</output>"+{-# INLINE output #-}++-- | Combinator for the @\<p>@ element.+--+-- Example:+--+-- > p $ span $ text "foo"+--+-- Result:+--+-- > <p><span>foo</span></p>+--+p :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+p = parent "<p" "</p>"+{-# INLINE p #-}++-- | Combinator for the @\<param />@ element.+--+-- Example:+--+-- > param+--+-- Result:+--+-- > <param />+--+param :: Html a -- ^ Resulting HTML.+param = leaf "<param"+{-# INLINE param #-}++-- | Combinator for the @\<pre>@ element.+--+-- Example:+--+-- > pre $ span $ text "foo"+--+-- Result:+--+-- > <pre><span>foo</span></pre>+--+pre :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+pre = parent "<pre" "</pre>"+{-# INLINE pre #-}++-- | Combinator for the @\<progress>@ element.+--+-- Example:+--+-- > progress $ span $ text "foo"+--+-- Result:+--+-- > <progress><span>foo</span></progress>+--+progress :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+progress = parent "<progress" "</progress>"+{-# INLINE progress #-}++-- | Combinator for the @\<q>@ element.+--+-- Example:+--+-- > q $ span $ text "foo"+--+-- Result:+--+-- > <q><span>foo</span></q>+--+q :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+q = parent "<q" "</q>"+{-# INLINE q #-}++-- | Combinator for the @\<rp>@ element.+--+-- Example:+--+-- > rp $ span $ text "foo"+--+-- Result:+--+-- > <rp><span>foo</span></rp>+--+rp :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+rp = parent "<rp" "</rp>"+{-# INLINE rp #-}++-- | Combinator for the @\<rt>@ element.+--+-- Example:+--+-- > rt $ span $ text "foo"+--+-- Result:+--+-- > <rt><span>foo</span></rt>+--+rt :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+rt = parent "<rt" "</rt>"+{-# INLINE rt #-}++-- | Combinator for the @\<ruby>@ element.+--+-- Example:+--+-- > ruby $ span $ text "foo"+--+-- Result:+--+-- > <ruby><span>foo</span></ruby>+--+ruby :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+ruby = parent "<ruby" "</ruby>"+{-# INLINE ruby #-}++-- | Combinator for the @\<samp>@ element.+--+-- Example:+--+-- > samp $ span $ text "foo"+--+-- Result:+--+-- > <samp><span>foo</span></samp>+--+samp :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+samp = parent "<samp" "</samp>"+{-# INLINE samp #-}++-- | Combinator for the @\<script>@ element.+--+-- Example:+--+-- > script $ span $ text "foo"+--+-- Result:+--+-- > <script><span>foo</span></script>+--+script :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+script = parent "<script" "</script>"+{-# INLINE script #-}++-- | Combinator for the @\<section>@ element.+--+-- Example:+--+-- > section $ span $ text "foo"+--+-- Result:+--+-- > <section><span>foo</span></section>+--+section :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+section = parent "<section" "</section>"+{-# INLINE section #-}++-- | Combinator for the @\<select>@ element.+--+-- Example:+--+-- > select $ span $ text "foo"+--+-- Result:+--+-- > <select><span>foo</span></select>+--+select :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+select = parent "<select" "</select>"+{-# INLINE select #-}++-- | Combinator for the @\<small>@ element.+--+-- Example:+--+-- > small $ span $ text "foo"+--+-- Result:+--+-- > <small><span>foo</span></small>+--+small :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+small = parent "<small" "</small>"+{-# INLINE small #-}++-- | Combinator for the @\<source>@ element.+--+-- Example:+--+-- > source $ span $ text "foo"+--+-- Result:+--+-- > <source><span>foo</span></source>+--+source :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+source = parent "<source" "</source>"+{-# INLINE source #-}++-- | Combinator for the @\<span>@ element.+--+-- Example:+--+-- > span $ span $ text "foo"+--+-- Result:+--+-- > <span><span>foo</span></span>+--+span :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+span = parent "<span" "</span>"+{-# INLINE span #-}++-- | Combinator for the @\<strong>@ element.+--+-- Example:+--+-- > strong $ span $ text "foo"+--+-- Result:+--+-- > <strong><span>foo</span></strong>+--+strong :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+strong = parent "<strong" "</strong>"+{-# INLINE strong #-}++-- | Combinator for the @\<style>@ element.+--+-- Example:+--+-- > style $ span $ text "foo"+--+-- Result:+--+-- > <style><span>foo</span></style>+--+style :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+style = parent "<style" "</style>"+{-# INLINE style #-}++-- | Combinator for the @\<sub>@ element.+--+-- Example:+--+-- > sub $ span $ text "foo"+--+-- Result:+--+-- > <sub><span>foo</span></sub>+--+sub :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+sub = parent "<sub" "</sub>"+{-# INLINE sub #-}++-- | Combinator for the @\<summary>@ element.+--+-- Example:+--+-- > summary $ span $ text "foo"+--+-- Result:+--+-- > <summary><span>foo</span></summary>+--+summary :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+summary = parent "<summary" "</summary>"+{-# INLINE summary #-}++-- | Combinator for the @\<sup>@ element.+--+-- Example:+--+-- > sup $ span $ text "foo"+--+-- Result:+--+-- > <sup><span>foo</span></sup>+--+sup :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+sup = parent "<sup" "</sup>"+{-# INLINE sup #-}++-- | Combinator for the @\<table>@ element.+--+-- Example:+--+-- > table $ span $ text "foo"+--+-- Result:+--+-- > <table><span>foo</span></table>+--+table :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+table = parent "<table" "</table>"+{-# INLINE table #-}++-- | Combinator for the @\<tbody>@ element.+--+-- Example:+--+-- > tbody $ span $ text "foo"+--+-- Result:+--+-- > <tbody><span>foo</span></tbody>+--+tbody :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+tbody = parent "<tbody" "</tbody>"+{-# INLINE tbody #-}++-- | Combinator for the @\<td>@ element.+--+-- Example:+--+-- > td $ span $ text "foo"+--+-- Result:+--+-- > <td><span>foo</span></td>+--+td :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+td = parent "<td" "</td>"+{-# INLINE td #-}++-- | Combinator for the @\<textarea>@ element.+--+-- Example:+--+-- > textarea $ span $ text "foo"+--+-- Result:+--+-- > <textarea><span>foo</span></textarea>+--+textarea :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+textarea = parent "<textarea" "</textarea>"+{-# INLINE textarea #-}++-- | Combinator for the @\<tfoot>@ element.+--+-- Example:+--+-- > tfoot $ span $ text "foo"+--+-- Result:+--+-- > <tfoot><span>foo</span></tfoot>+--+tfoot :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+tfoot = parent "<tfoot" "</tfoot>"+{-# INLINE tfoot #-}++-- | Combinator for the @\<th>@ element.+--+-- Example:+--+-- > th $ span $ text "foo"+--+-- Result:+--+-- > <th><span>foo</span></th>+--+th :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+th = parent "<th" "</th>"+{-# INLINE th #-}++-- | Combinator for the @\<thead>@ element.+--+-- Example:+--+-- > thead $ span $ text "foo"+--+-- Result:+--+-- > <thead><span>foo</span></thead>+--+thead :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+thead = parent "<thead" "</thead>"+{-# INLINE thead #-}++-- | Combinator for the @\<time>@ element.+--+-- Example:+--+-- > time $ span $ text "foo"+--+-- Result:+--+-- > <time><span>foo</span></time>+--+time :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+time = parent "<time" "</time>"+{-# INLINE time #-}++-- | Combinator for the @\<title>@ element.+--+-- Example:+--+-- > title $ span $ text "foo"+--+-- Result:+--+-- > <title><span>foo</span></title>+--+title :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+title = parent "<title" "</title>"+{-# INLINE title #-}++-- | Combinator for the @\<tr>@ element.+--+-- Example:+--+-- > tr $ span $ text "foo"+--+-- Result:+--+-- > <tr><span>foo</span></tr>+--+tr :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+tr = parent "<tr" "</tr>"+{-# INLINE tr #-}++-- | Combinator for the @\<ul>@ element.+--+-- Example:+--+-- > ul $ span $ text "foo"+--+-- Result:+--+-- > <ul><span>foo</span></ul>+--+ul :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+ul = parent "<ul" "</ul>"+{-# INLINE ul #-}++-- | Combinator for the @\<var>@ element.+--+-- Example:+--+-- > var $ span $ text "foo"+--+-- Result:+--+-- > <var><span>foo</span></var>+--+var :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+var = parent "<var" "</var>"+{-# INLINE var #-}++-- | Combinator for the @\<video>@ element.+--+-- Example:+--+-- > video $ span $ text "foo"+--+-- Result:+--+-- > <video><span>foo</span></video>+--+video :: Html a -- ^ Inner HTML.+ -> Html b -- ^ Resulting HTML.+video = parent "<video" "</video>"+{-# INLINE video #-}
+ src/Text/Blaze/Html5/Attributes.hs view
@@ -0,0 +1,1948 @@+{-# LANGUAGE OverloadedStrings #-}+-- | This module exports combinators that provide you with the+-- ability to set attributes on HTML elements.+--+module Text.Blaze.Html5.Attributes+ ( accept+ , accept_charset+ , accesskey+ , action+ , alt+ , async+ , autocomplete+ , autofocus+ , autoplay+ , challenge+ , charset+ , checked+ , cite+ , class_+ , cols+ , colspan+ , content+ , contenteditable+ , contextmenu+ , controls+ , coords+ , data_+ , datetime+ , defer+ , dir+ , disabled+ , draggable+ , enctype+ , for+ , form+ , formaction+ , formenctype+ , formmethod+ , formnovalidate+ , formtarget+ , headers+ , height+ , hidden+ , high+ , href+ , hreflang+ , http_equiv+ , icon+ , id+ , ismap+ , item+ , itemprop+ , keytype+ , label+ , lang+ , list+ , loop+ , low+ , manifest+ , max+ , maxlength+ , media+ , method+ , min+ , multiple+ , name+ , novalidate+ , onafterprint+ , onbeforeonload+ , onbeforeprint+ , onblur+ , onerror+ , onfocus+ , onhaschange+ , onload+ , onmessage+ , onoffline+ , ononline+ , onpagehide+ , onpageshow+ , onpropstate+ , onredo+ , onresize+ , onstorage+ , onundo+ , onunload+ , open+ , optimum+ , pattern+ , ping+ , placeholder+ , preload+ , pubdate+ , radiogroup+ , readonly+ , rel+ , required+ , reversed+ , rows+ , rowspan+ , sandbox+ , scope+ , scoped+ , seamless+ , selected+ , shape+ , size+ , sizes+ , span+ , spellcheck+ , src+ , srcdoc+ , start+ , step+ , style+ , subject+ , summary+ , tabindex+ , target+ , title+ , type_+ , usemap+ , value+ , width+ , wrap+ , xmlns+ ) where++import Prelude ()++import Data.Text (Text)++import Text.Blaze.Internal (Attribute, AttributeValue, attribute)++-- | Combinator for the @accept@ attribute.+--+-- Example:+--+-- > div <! accept "bar" $ "Hello."+--+-- Result:+--+-- > <div accept="bar">Hello.</div>+--+accept :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+accept = attribute " accept=\""+{-# INLINE accept #-}++-- | Combinator for the @accept-charset@ attribute.+--+-- Example:+--+-- > div <! accept_charset "bar" $ "Hello."+--+-- Result:+--+-- > <div accept-charset="bar">Hello.</div>+--+accept_charset :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+accept_charset = attribute " accept-charset=\""+{-# INLINE accept_charset #-}++-- | Combinator for the @accesskey@ attribute.+--+-- Example:+--+-- > div <! accesskey "bar" $ "Hello."+--+-- Result:+--+-- > <div accesskey="bar">Hello.</div>+--+accesskey :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+accesskey = attribute " accesskey=\""+{-# INLINE accesskey #-}++-- | Combinator for the @action@ attribute.+--+-- Example:+--+-- > div <! action "bar" $ "Hello."+--+-- Result:+--+-- > <div action="bar">Hello.</div>+--+action :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+action = attribute " action=\""+{-# INLINE action #-}++-- | Combinator for the @alt@ attribute.+--+-- Example:+--+-- > div <! alt "bar" $ "Hello."+--+-- Result:+--+-- > <div alt="bar">Hello.</div>+--+alt :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+alt = attribute " alt=\""+{-# INLINE alt #-}++-- | Combinator for the @async@ attribute.+--+-- Example:+--+-- > div <! async "bar" $ "Hello."+--+-- Result:+--+-- > <div async="bar">Hello.</div>+--+async :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+async = attribute " async=\""+{-# INLINE async #-}++-- | Combinator for the @autocomplete@ attribute.+--+-- Example:+--+-- > div <! autocomplete "bar" $ "Hello."+--+-- Result:+--+-- > <div autocomplete="bar">Hello.</div>+--+autocomplete :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+autocomplete = attribute " autocomplete=\""+{-# INLINE autocomplete #-}++-- | Combinator for the @autofocus@ attribute.+--+-- Example:+--+-- > div <! autofocus "bar" $ "Hello."+--+-- Result:+--+-- > <div autofocus="bar">Hello.</div>+--+autofocus :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+autofocus = attribute " autofocus=\""+{-# INLINE autofocus #-}++-- | Combinator for the @autoplay@ attribute.+--+-- Example:+--+-- > div <! autoplay "bar" $ "Hello."+--+-- Result:+--+-- > <div autoplay="bar">Hello.</div>+--+autoplay :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+autoplay = attribute " autoplay=\""+{-# INLINE autoplay #-}++-- | Combinator for the @challenge@ attribute.+--+-- Example:+--+-- > div <! challenge "bar" $ "Hello."+--+-- Result:+--+-- > <div challenge="bar">Hello.</div>+--+challenge :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+challenge = attribute " challenge=\""+{-# INLINE challenge #-}++-- | Combinator for the @charset@ attribute.+--+-- Example:+--+-- > div <! charset "bar" $ "Hello."+--+-- Result:+--+-- > <div charset="bar">Hello.</div>+--+charset :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+charset = attribute " charset=\""+{-# INLINE charset #-}++-- | Combinator for the @checked@ attribute.+--+-- Example:+--+-- > div <! checked "bar" $ "Hello."+--+-- Result:+--+-- > <div checked="bar">Hello.</div>+--+checked :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+checked = attribute " checked=\""+{-# INLINE checked #-}++-- | Combinator for the @cite@ attribute.+--+-- Example:+--+-- > div <! cite "bar" $ "Hello."+--+-- Result:+--+-- > <div cite="bar">Hello.</div>+--+cite :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+cite = attribute " cite=\""+{-# INLINE cite #-}++-- | Combinator for the @class@ attribute.+--+-- Example:+--+-- > div <! class_ "bar" $ "Hello."+--+-- Result:+--+-- > <div class="bar">Hello.</div>+--+class_ :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+class_ = attribute " class=\""+{-# INLINE class_ #-}++-- | Combinator for the @cols@ attribute.+--+-- Example:+--+-- > div <! cols "bar" $ "Hello."+--+-- Result:+--+-- > <div cols="bar">Hello.</div>+--+cols :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+cols = attribute " cols=\""+{-# INLINE cols #-}++-- | Combinator for the @colspan@ attribute.+--+-- Example:+--+-- > div <! colspan "bar" $ "Hello."+--+-- Result:+--+-- > <div colspan="bar">Hello.</div>+--+colspan :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+colspan = attribute " colspan=\""+{-# INLINE colspan #-}++-- | Combinator for the @content@ attribute.+--+-- Example:+--+-- > div <! content "bar" $ "Hello."+--+-- Result:+--+-- > <div content="bar">Hello.</div>+--+content :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+content = attribute " content=\""+{-# INLINE content #-}++-- | Combinator for the @contenteditable@ attribute.+--+-- Example:+--+-- > div <! contenteditable "bar" $ "Hello."+--+-- Result:+--+-- > <div contenteditable="bar">Hello.</div>+--+contenteditable :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+contenteditable = attribute " contenteditable=\""+{-# INLINE contenteditable #-}++-- | Combinator for the @contextmenu@ attribute.+--+-- Example:+--+-- > div <! contextmenu "bar" $ "Hello."+--+-- Result:+--+-- > <div contextmenu="bar">Hello.</div>+--+contextmenu :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+contextmenu = attribute " contextmenu=\""+{-# INLINE contextmenu #-}++-- | Combinator for the @controls@ attribute.+--+-- Example:+--+-- > div <! controls "bar" $ "Hello."+--+-- Result:+--+-- > <div controls="bar">Hello.</div>+--+controls :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+controls = attribute " controls=\""+{-# INLINE controls #-}++-- | Combinator for the @coords@ attribute.+--+-- Example:+--+-- > div <! coords "bar" $ "Hello."+--+-- Result:+--+-- > <div coords="bar">Hello.</div>+--+coords :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+coords = attribute " coords=\""+{-# INLINE coords #-}++-- | Combinator for the @data@ attribute.+--+-- Example:+--+-- > div <! data_ "bar" $ "Hello."+--+-- Result:+--+-- > <div data="bar">Hello.</div>+--+data_ :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+data_ = attribute " data=\""+{-# INLINE data_ #-}++-- | Combinator for the @datetime@ attribute.+--+-- Example:+--+-- > div <! datetime "bar" $ "Hello."+--+-- Result:+--+-- > <div datetime="bar">Hello.</div>+--+datetime :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+datetime = attribute " datetime=\""+{-# INLINE datetime #-}++-- | Combinator for the @defer@ attribute.+--+-- Example:+--+-- > div <! defer "bar" $ "Hello."+--+-- Result:+--+-- > <div defer="bar">Hello.</div>+--+defer :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+defer = attribute " defer=\""+{-# INLINE defer #-}++-- | Combinator for the @dir@ attribute.+--+-- Example:+--+-- > div <! dir "bar" $ "Hello."+--+-- Result:+--+-- > <div dir="bar">Hello.</div>+--+dir :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+dir = attribute " dir=\""+{-# INLINE dir #-}++-- | Combinator for the @disabled@ attribute.+--+-- Example:+--+-- > div <! disabled "bar" $ "Hello."+--+-- Result:+--+-- > <div disabled="bar">Hello.</div>+--+disabled :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+disabled = attribute " disabled=\""+{-# INLINE disabled #-}++-- | Combinator for the @draggable@ attribute.+--+-- Example:+--+-- > div <! draggable "bar" $ "Hello."+--+-- Result:+--+-- > <div draggable="bar">Hello.</div>+--+draggable :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+draggable = attribute " draggable=\""+{-# INLINE draggable #-}++-- | Combinator for the @enctype@ attribute.+--+-- Example:+--+-- > div <! enctype "bar" $ "Hello."+--+-- Result:+--+-- > <div enctype="bar">Hello.</div>+--+enctype :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+enctype = attribute " enctype=\""+{-# INLINE enctype #-}++-- | Combinator for the @for@ attribute.+--+-- Example:+--+-- > div <! for "bar" $ "Hello."+--+-- Result:+--+-- > <div for="bar">Hello.</div>+--+for :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+for = attribute " for=\""+{-# INLINE for #-}++-- | Combinator for the @form@ attribute.+--+-- Example:+--+-- > div <! form "bar" $ "Hello."+--+-- Result:+--+-- > <div form="bar">Hello.</div>+--+form :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+form = attribute " form=\""+{-# INLINE form #-}++-- | Combinator for the @formaction@ attribute.+--+-- Example:+--+-- > div <! formaction "bar" $ "Hello."+--+-- Result:+--+-- > <div formaction="bar">Hello.</div>+--+formaction :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+formaction = attribute " formaction=\""+{-# INLINE formaction #-}++-- | Combinator for the @formenctype@ attribute.+--+-- Example:+--+-- > div <! formenctype "bar" $ "Hello."+--+-- Result:+--+-- > <div formenctype="bar">Hello.</div>+--+formenctype :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+formenctype = attribute " formenctype=\""+{-# INLINE formenctype #-}++-- | Combinator for the @formmethod@ attribute.+--+-- Example:+--+-- > div <! formmethod "bar" $ "Hello."+--+-- Result:+--+-- > <div formmethod="bar">Hello.</div>+--+formmethod :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+formmethod = attribute " formmethod=\""+{-# INLINE formmethod #-}++-- | Combinator for the @formnovalidate@ attribute.+--+-- Example:+--+-- > div <! formnovalidate "bar" $ "Hello."+--+-- Result:+--+-- > <div formnovalidate="bar">Hello.</div>+--+formnovalidate :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+formnovalidate = attribute " formnovalidate=\""+{-# INLINE formnovalidate #-}++-- | Combinator for the @formtarget@ attribute.+--+-- Example:+--+-- > div <! formtarget "bar" $ "Hello."+--+-- Result:+--+-- > <div formtarget="bar">Hello.</div>+--+formtarget :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+formtarget = attribute " formtarget=\""+{-# INLINE formtarget #-}++-- | Combinator for the @headers@ attribute.+--+-- Example:+--+-- > div <! headers "bar" $ "Hello."+--+-- Result:+--+-- > <div headers="bar">Hello.</div>+--+headers :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+headers = attribute " headers=\""+{-# INLINE headers #-}++-- | Combinator for the @height@ attribute.+--+-- Example:+--+-- > div <! height "bar" $ "Hello."+--+-- Result:+--+-- > <div height="bar">Hello.</div>+--+height :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+height = attribute " height=\""+{-# INLINE height #-}++-- | Combinator for the @hidden@ attribute.+--+-- Example:+--+-- > div <! hidden "bar" $ "Hello."+--+-- Result:+--+-- > <div hidden="bar">Hello.</div>+--+hidden :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+hidden = attribute " hidden=\""+{-# INLINE hidden #-}++-- | Combinator for the @high@ attribute.+--+-- Example:+--+-- > div <! high "bar" $ "Hello."+--+-- Result:+--+-- > <div high="bar">Hello.</div>+--+high :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+high = attribute " high=\""+{-# INLINE high #-}++-- | Combinator for the @href@ attribute.+--+-- Example:+--+-- > div <! href "bar" $ "Hello."+--+-- Result:+--+-- > <div href="bar">Hello.</div>+--+href :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+href = attribute " href=\""+{-# INLINE href #-}++-- | Combinator for the @hreflang@ attribute.+--+-- Example:+--+-- > div <! hreflang "bar" $ "Hello."+--+-- Result:+--+-- > <div hreflang="bar">Hello.</div>+--+hreflang :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+hreflang = attribute " hreflang=\""+{-# INLINE hreflang #-}++-- | Combinator for the @http-equiv@ attribute.+--+-- Example:+--+-- > div <! http_equiv "bar" $ "Hello."+--+-- Result:+--+-- > <div http-equiv="bar">Hello.</div>+--+http_equiv :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+http_equiv = attribute " http-equiv=\""+{-# INLINE http_equiv #-}++-- | Combinator for the @icon@ attribute.+--+-- Example:+--+-- > div <! icon "bar" $ "Hello."+--+-- Result:+--+-- > <div icon="bar">Hello.</div>+--+icon :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+icon = attribute " icon=\""+{-# INLINE icon #-}++-- | Combinator for the @id@ attribute.+--+-- Example:+--+-- > div <! id "bar" $ "Hello."+--+-- Result:+--+-- > <div id="bar">Hello.</div>+--+id :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+id = attribute " id=\""+{-# INLINE id #-}++-- | Combinator for the @ismap@ attribute.+--+-- Example:+--+-- > div <! ismap "bar" $ "Hello."+--+-- Result:+--+-- > <div ismap="bar">Hello.</div>+--+ismap :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+ismap = attribute " ismap=\""+{-# INLINE ismap #-}++-- | Combinator for the @item@ attribute.+--+-- Example:+--+-- > div <! item "bar" $ "Hello."+--+-- Result:+--+-- > <div item="bar">Hello.</div>+--+item :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+item = attribute " item=\""+{-# INLINE item #-}++-- | Combinator for the @itemprop@ attribute.+--+-- Example:+--+-- > div <! itemprop "bar" $ "Hello."+--+-- Result:+--+-- > <div itemprop="bar">Hello.</div>+--+itemprop :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+itemprop = attribute " itemprop=\""+{-# INLINE itemprop #-}++-- | Combinator for the @keytype@ attribute.+--+-- Example:+--+-- > div <! keytype "bar" $ "Hello."+--+-- Result:+--+-- > <div keytype="bar">Hello.</div>+--+keytype :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+keytype = attribute " keytype=\""+{-# INLINE keytype #-}++-- | Combinator for the @label@ attribute.+--+-- Example:+--+-- > div <! label "bar" $ "Hello."+--+-- Result:+--+-- > <div label="bar">Hello.</div>+--+label :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+label = attribute " label=\""+{-# INLINE label #-}++-- | Combinator for the @lang@ attribute.+--+-- Example:+--+-- > div <! lang "bar" $ "Hello."+--+-- Result:+--+-- > <div lang="bar">Hello.</div>+--+lang :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+lang = attribute " lang=\""+{-# INLINE lang #-}++-- | Combinator for the @list@ attribute.+--+-- Example:+--+-- > div <! list "bar" $ "Hello."+--+-- Result:+--+-- > <div list="bar">Hello.</div>+--+list :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+list = attribute " list=\""+{-# INLINE list #-}++-- | Combinator for the @loop@ attribute.+--+-- Example:+--+-- > div <! loop "bar" $ "Hello."+--+-- Result:+--+-- > <div loop="bar">Hello.</div>+--+loop :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+loop = attribute " loop=\""+{-# INLINE loop #-}++-- | Combinator for the @low@ attribute.+--+-- Example:+--+-- > div <! low "bar" $ "Hello."+--+-- Result:+--+-- > <div low="bar">Hello.</div>+--+low :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+low = attribute " low=\""+{-# INLINE low #-}++-- | Combinator for the @manifest@ attribute.+--+-- Example:+--+-- > div <! manifest "bar" $ "Hello."+--+-- Result:+--+-- > <div manifest="bar">Hello.</div>+--+manifest :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+manifest = attribute " manifest=\""+{-# INLINE manifest #-}++-- | Combinator for the @max@ attribute.+--+-- Example:+--+-- > div <! max "bar" $ "Hello."+--+-- Result:+--+-- > <div max="bar">Hello.</div>+--+max :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+max = attribute " max=\""+{-# INLINE max #-}++-- | Combinator for the @maxlength@ attribute.+--+-- Example:+--+-- > div <! maxlength "bar" $ "Hello."+--+-- Result:+--+-- > <div maxlength="bar">Hello.</div>+--+maxlength :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+maxlength = attribute " maxlength=\""+{-# INLINE maxlength #-}++-- | Combinator for the @media@ attribute.+--+-- Example:+--+-- > div <! media "bar" $ "Hello."+--+-- Result:+--+-- > <div media="bar">Hello.</div>+--+media :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+media = attribute " media=\""+{-# INLINE media #-}++-- | Combinator for the @method@ attribute.+--+-- Example:+--+-- > div <! method "bar" $ "Hello."+--+-- Result:+--+-- > <div method="bar">Hello.</div>+--+method :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+method = attribute " method=\""+{-# INLINE method #-}++-- | Combinator for the @min@ attribute.+--+-- Example:+--+-- > div <! min "bar" $ "Hello."+--+-- Result:+--+-- > <div min="bar">Hello.</div>+--+min :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+min = attribute " min=\""+{-# INLINE min #-}++-- | Combinator for the @multiple@ attribute.+--+-- Example:+--+-- > div <! multiple "bar" $ "Hello."+--+-- Result:+--+-- > <div multiple="bar">Hello.</div>+--+multiple :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+multiple = attribute " multiple=\""+{-# INLINE multiple #-}++-- | Combinator for the @name@ attribute.+--+-- Example:+--+-- > div <! name "bar" $ "Hello."+--+-- Result:+--+-- > <div name="bar">Hello.</div>+--+name :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+name = attribute " name=\""+{-# INLINE name #-}++-- | Combinator for the @novalidate@ attribute.+--+-- Example:+--+-- > div <! novalidate "bar" $ "Hello."+--+-- Result:+--+-- > <div novalidate="bar">Hello.</div>+--+novalidate :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+novalidate = attribute " novalidate=\""+{-# INLINE novalidate #-}++-- | Combinator for the @onafterprint@ attribute.+--+-- Example:+--+-- > div <! onafterprint "bar" $ "Hello."+--+-- Result:+--+-- > <div onafterprint="bar">Hello.</div>+--+onafterprint :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onafterprint = attribute " onafterprint=\""+{-# INLINE onafterprint #-}++-- | Combinator for the @onbeforeonload@ attribute.+--+-- Example:+--+-- > div <! onbeforeonload "bar" $ "Hello."+--+-- Result:+--+-- > <div onbeforeonload="bar">Hello.</div>+--+onbeforeonload :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onbeforeonload = attribute " onbeforeonload=\""+{-# INLINE onbeforeonload #-}++-- | Combinator for the @onbeforeprint@ attribute.+--+-- Example:+--+-- > div <! onbeforeprint "bar" $ "Hello."+--+-- Result:+--+-- > <div onbeforeprint="bar">Hello.</div>+--+onbeforeprint :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onbeforeprint = attribute " onbeforeprint=\""+{-# INLINE onbeforeprint #-}++-- | Combinator for the @onblur@ attribute.+--+-- Example:+--+-- > div <! onblur "bar" $ "Hello."+--+-- Result:+--+-- > <div onblur="bar">Hello.</div>+--+onblur :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onblur = attribute " onblur=\""+{-# INLINE onblur #-}++-- | Combinator for the @onerror@ attribute.+--+-- Example:+--+-- > div <! onerror "bar" $ "Hello."+--+-- Result:+--+-- > <div onerror="bar">Hello.</div>+--+onerror :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onerror = attribute " onerror=\""+{-# INLINE onerror #-}++-- | Combinator for the @onfocus@ attribute.+--+-- Example:+--+-- > div <! onfocus "bar" $ "Hello."+--+-- Result:+--+-- > <div onfocus="bar">Hello.</div>+--+onfocus :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onfocus = attribute " onfocus=\""+{-# INLINE onfocus #-}++-- | Combinator for the @onhaschange@ attribute.+--+-- Example:+--+-- > div <! onhaschange "bar" $ "Hello."+--+-- Result:+--+-- > <div onhaschange="bar">Hello.</div>+--+onhaschange :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onhaschange = attribute " onhaschange=\""+{-# INLINE onhaschange #-}++-- | Combinator for the @onload@ attribute.+--+-- Example:+--+-- > div <! onload "bar" $ "Hello."+--+-- Result:+--+-- > <div onload="bar">Hello.</div>+--+onload :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onload = attribute " onload=\""+{-# INLINE onload #-}++-- | Combinator for the @onmessage@ attribute.+--+-- Example:+--+-- > div <! onmessage "bar" $ "Hello."+--+-- Result:+--+-- > <div onmessage="bar">Hello.</div>+--+onmessage :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onmessage = attribute " onmessage=\""+{-# INLINE onmessage #-}++-- | Combinator for the @onoffline@ attribute.+--+-- Example:+--+-- > div <! onoffline "bar" $ "Hello."+--+-- Result:+--+-- > <div onoffline="bar">Hello.</div>+--+onoffline :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onoffline = attribute " onoffline=\""+{-# INLINE onoffline #-}++-- | Combinator for the @ononline@ attribute.+--+-- Example:+--+-- > div <! ononline "bar" $ "Hello."+--+-- Result:+--+-- > <div ononline="bar">Hello.</div>+--+ononline :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+ononline = attribute " ononline=\""+{-# INLINE ononline #-}++-- | Combinator for the @onpagehide@ attribute.+--+-- Example:+--+-- > div <! onpagehide "bar" $ "Hello."+--+-- Result:+--+-- > <div onpagehide="bar">Hello.</div>+--+onpagehide :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onpagehide = attribute " onpagehide=\""+{-# INLINE onpagehide #-}++-- | Combinator for the @onpageshow@ attribute.+--+-- Example:+--+-- > div <! onpageshow "bar" $ "Hello."+--+-- Result:+--+-- > <div onpageshow="bar">Hello.</div>+--+onpageshow :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onpageshow = attribute " onpageshow=\""+{-# INLINE onpageshow #-}++-- | Combinator for the @onpropstate@ attribute.+--+-- Example:+--+-- > div <! onpropstate "bar" $ "Hello."+--+-- Result:+--+-- > <div onpropstate="bar">Hello.</div>+--+onpropstate :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onpropstate = attribute " onpropstate=\""+{-# INLINE onpropstate #-}++-- | Combinator for the @onredo@ attribute.+--+-- Example:+--+-- > div <! onredo "bar" $ "Hello."+--+-- Result:+--+-- > <div onredo="bar">Hello.</div>+--+onredo :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onredo = attribute " onredo=\""+{-# INLINE onredo #-}++-- | Combinator for the @onresize@ attribute.+--+-- Example:+--+-- > div <! onresize "bar" $ "Hello."+--+-- Result:+--+-- > <div onresize="bar">Hello.</div>+--+onresize :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onresize = attribute " onresize=\""+{-# INLINE onresize #-}++-- | Combinator for the @onstorage@ attribute.+--+-- Example:+--+-- > div <! onstorage "bar" $ "Hello."+--+-- Result:+--+-- > <div onstorage="bar">Hello.</div>+--+onstorage :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onstorage = attribute " onstorage=\""+{-# INLINE onstorage #-}++-- | Combinator for the @onundo@ attribute.+--+-- Example:+--+-- > div <! onundo "bar" $ "Hello."+--+-- Result:+--+-- > <div onundo="bar">Hello.</div>+--+onundo :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onundo = attribute " onundo=\""+{-# INLINE onundo #-}++-- | Combinator for the @onunload@ attribute.+--+-- Example:+--+-- > div <! onunload "bar" $ "Hello."+--+-- Result:+--+-- > <div onunload="bar">Hello.</div>+--+onunload :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+onunload = attribute " onunload=\""+{-# INLINE onunload #-}++-- | Combinator for the @open@ attribute.+--+-- Example:+--+-- > div <! open "bar" $ "Hello."+--+-- Result:+--+-- > <div open="bar">Hello.</div>+--+open :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+open = attribute " open=\""+{-# INLINE open #-}++-- | Combinator for the @optimum@ attribute.+--+-- Example:+--+-- > div <! optimum "bar" $ "Hello."+--+-- Result:+--+-- > <div optimum="bar">Hello.</div>+--+optimum :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+optimum = attribute " optimum=\""+{-# INLINE optimum #-}++-- | Combinator for the @pattern@ attribute.+--+-- Example:+--+-- > div <! pattern "bar" $ "Hello."+--+-- Result:+--+-- > <div pattern="bar">Hello.</div>+--+pattern :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+pattern = attribute " pattern=\""+{-# INLINE pattern #-}++-- | Combinator for the @ping@ attribute.+--+-- Example:+--+-- > div <! ping "bar" $ "Hello."+--+-- Result:+--+-- > <div ping="bar">Hello.</div>+--+ping :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+ping = attribute " ping=\""+{-# INLINE ping #-}++-- | Combinator for the @placeholder@ attribute.+--+-- Example:+--+-- > div <! placeholder "bar" $ "Hello."+--+-- Result:+--+-- > <div placeholder="bar">Hello.</div>+--+placeholder :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+placeholder = attribute " placeholder=\""+{-# INLINE placeholder #-}++-- | Combinator for the @preload@ attribute.+--+-- Example:+--+-- > div <! preload "bar" $ "Hello."+--+-- Result:+--+-- > <div preload="bar">Hello.</div>+--+preload :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+preload = attribute " preload=\""+{-# INLINE preload #-}++-- | Combinator for the @pubdate@ attribute.+--+-- Example:+--+-- > div <! pubdate "bar" $ "Hello."+--+-- Result:+--+-- > <div pubdate="bar">Hello.</div>+--+pubdate :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+pubdate = attribute " pubdate=\""+{-# INLINE pubdate #-}++-- | Combinator for the @radiogroup@ attribute.+--+-- Example:+--+-- > div <! radiogroup "bar" $ "Hello."+--+-- Result:+--+-- > <div radiogroup="bar">Hello.</div>+--+radiogroup :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+radiogroup = attribute " radiogroup=\""+{-# INLINE radiogroup #-}++-- | Combinator for the @readonly@ attribute.+--+-- Example:+--+-- > div <! readonly "bar" $ "Hello."+--+-- Result:+--+-- > <div readonly="bar">Hello.</div>+--+readonly :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+readonly = attribute " readonly=\""+{-# INLINE readonly #-}++-- | Combinator for the @rel@ attribute.+--+-- Example:+--+-- > div <! rel "bar" $ "Hello."+--+-- Result:+--+-- > <div rel="bar">Hello.</div>+--+rel :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+rel = attribute " rel=\""+{-# INLINE rel #-}++-- | Combinator for the @required@ attribute.+--+-- Example:+--+-- > div <! required "bar" $ "Hello."+--+-- Result:+--+-- > <div required="bar">Hello.</div>+--+required :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+required = attribute " required=\""+{-# INLINE required #-}++-- | Combinator for the @reversed@ attribute.+--+-- Example:+--+-- > div <! reversed "bar" $ "Hello."+--+-- Result:+--+-- > <div reversed="bar">Hello.</div>+--+reversed :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+reversed = attribute " reversed=\""+{-# INLINE reversed #-}++-- | Combinator for the @rows@ attribute.+--+-- Example:+--+-- > div <! rows "bar" $ "Hello."+--+-- Result:+--+-- > <div rows="bar">Hello.</div>+--+rows :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+rows = attribute " rows=\""+{-# INLINE rows #-}++-- | Combinator for the @rowspan@ attribute.+--+-- Example:+--+-- > div <! rowspan "bar" $ "Hello."+--+-- Result:+--+-- > <div rowspan="bar">Hello.</div>+--+rowspan :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+rowspan = attribute " rowspan=\""+{-# INLINE rowspan #-}++-- | Combinator for the @sandbox@ attribute.+--+-- Example:+--+-- > div <! sandbox "bar" $ "Hello."+--+-- Result:+--+-- > <div sandbox="bar">Hello.</div>+--+sandbox :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+sandbox = attribute " sandbox=\""+{-# INLINE sandbox #-}++-- | Combinator for the @scope@ attribute.+--+-- Example:+--+-- > div <! scope "bar" $ "Hello."+--+-- Result:+--+-- > <div scope="bar">Hello.</div>+--+scope :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+scope = attribute " scope=\""+{-# INLINE scope #-}++-- | Combinator for the @scoped@ attribute.+--+-- Example:+--+-- > div <! scoped "bar" $ "Hello."+--+-- Result:+--+-- > <div scoped="bar">Hello.</div>+--+scoped :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+scoped = attribute " scoped=\""+{-# INLINE scoped #-}++-- | Combinator for the @seamless@ attribute.+--+-- Example:+--+-- > div <! seamless "bar" $ "Hello."+--+-- Result:+--+-- > <div seamless="bar">Hello.</div>+--+seamless :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+seamless = attribute " seamless=\""+{-# INLINE seamless #-}++-- | Combinator for the @selected@ attribute.+--+-- Example:+--+-- > div <! selected "bar" $ "Hello."+--+-- Result:+--+-- > <div selected="bar">Hello.</div>+--+selected :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+selected = attribute " selected=\""+{-# INLINE selected #-}++-- | Combinator for the @shape@ attribute.+--+-- Example:+--+-- > div <! shape "bar" $ "Hello."+--+-- Result:+--+-- > <div shape="bar">Hello.</div>+--+shape :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+shape = attribute " shape=\""+{-# INLINE shape #-}++-- | Combinator for the @size@ attribute.+--+-- Example:+--+-- > div <! size "bar" $ "Hello."+--+-- Result:+--+-- > <div size="bar">Hello.</div>+--+size :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+size = attribute " size=\""+{-# INLINE size #-}++-- | Combinator for the @sizes@ attribute.+--+-- Example:+--+-- > div <! sizes "bar" $ "Hello."+--+-- Result:+--+-- > <div sizes="bar">Hello.</div>+--+sizes :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+sizes = attribute " sizes=\""+{-# INLINE sizes #-}++-- | Combinator for the @span@ attribute.+--+-- Example:+--+-- > div <! span "bar" $ "Hello."+--+-- Result:+--+-- > <div span="bar">Hello.</div>+--+span :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+span = attribute " span=\""+{-# INLINE span #-}++-- | Combinator for the @spellcheck@ attribute.+--+-- Example:+--+-- > div <! spellcheck "bar" $ "Hello."+--+-- Result:+--+-- > <div spellcheck="bar">Hello.</div>+--+spellcheck :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+spellcheck = attribute " spellcheck=\""+{-# INLINE spellcheck #-}++-- | Combinator for the @src@ attribute.+--+-- Example:+--+-- > div <! src "bar" $ "Hello."+--+-- Result:+--+-- > <div src="bar">Hello.</div>+--+src :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+src = attribute " src=\""+{-# INLINE src #-}++-- | Combinator for the @srcdoc@ attribute.+--+-- Example:+--+-- > div <! srcdoc "bar" $ "Hello."+--+-- Result:+--+-- > <div srcdoc="bar">Hello.</div>+--+srcdoc :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+srcdoc = attribute " srcdoc=\""+{-# INLINE srcdoc #-}++-- | Combinator for the @start@ attribute.+--+-- Example:+--+-- > div <! start "bar" $ "Hello."+--+-- Result:+--+-- > <div start="bar">Hello.</div>+--+start :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+start = attribute " start=\""+{-# INLINE start #-}++-- | Combinator for the @step@ attribute.+--+-- Example:+--+-- > div <! step "bar" $ "Hello."+--+-- Result:+--+-- > <div step="bar">Hello.</div>+--+step :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+step = attribute " step=\""+{-# INLINE step #-}++-- | Combinator for the @style@ attribute.+--+-- Example:+--+-- > div <! style "bar" $ "Hello."+--+-- Result:+--+-- > <div style="bar">Hello.</div>+--+style :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+style = attribute " style=\""+{-# INLINE style #-}++-- | Combinator for the @subject@ attribute.+--+-- Example:+--+-- > div <! subject "bar" $ "Hello."+--+-- Result:+--+-- > <div subject="bar">Hello.</div>+--+subject :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+subject = attribute " subject=\""+{-# INLINE subject #-}++-- | Combinator for the @summary@ attribute.+--+-- Example:+--+-- > div <! summary "bar" $ "Hello."+--+-- Result:+--+-- > <div summary="bar">Hello.</div>+--+summary :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+summary = attribute " summary=\""+{-# INLINE summary #-}++-- | Combinator for the @tabindex@ attribute.+--+-- Example:+--+-- > div <! tabindex "bar" $ "Hello."+--+-- Result:+--+-- > <div tabindex="bar">Hello.</div>+--+tabindex :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+tabindex = attribute " tabindex=\""+{-# INLINE tabindex #-}++-- | Combinator for the @target@ attribute.+--+-- Example:+--+-- > div <! target "bar" $ "Hello."+--+-- Result:+--+-- > <div target="bar">Hello.</div>+--+target :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+target = attribute " target=\""+{-# INLINE target #-}++-- | Combinator for the @title@ attribute.+--+-- Example:+--+-- > div <! title "bar" $ "Hello."+--+-- Result:+--+-- > <div title="bar">Hello.</div>+--+title :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+title = attribute " title=\""+{-# INLINE title #-}++-- | Combinator for the @type@ attribute.+--+-- Example:+--+-- > div <! type_ "bar" $ "Hello."+--+-- Result:+--+-- > <div type="bar">Hello.</div>+--+type_ :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+type_ = attribute " type=\""+{-# INLINE type_ #-}++-- | Combinator for the @usemap@ attribute.+--+-- Example:+--+-- > div <! usemap "bar" $ "Hello."+--+-- Result:+--+-- > <div usemap="bar">Hello.</div>+--+usemap :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+usemap = attribute " usemap=\""+{-# INLINE usemap #-}++-- | Combinator for the @value@ attribute.+--+-- Example:+--+-- > div <! value "bar" $ "Hello."+--+-- Result:+--+-- > <div value="bar">Hello.</div>+--+value :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+value = attribute " value=\""+{-# INLINE value #-}++-- | Combinator for the @width@ attribute.+--+-- Example:+--+-- > div <! width "bar" $ "Hello."+--+-- Result:+--+-- > <div width="bar">Hello.</div>+--+width :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+width = attribute " width=\""+{-# INLINE width #-}++-- | Combinator for the @wrap@ attribute.+--+-- Example:+--+-- > div <! wrap "bar" $ "Hello."+--+-- Result:+--+-- > <div wrap="bar">Hello.</div>+--+wrap :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+wrap = attribute " wrap=\""+{-# INLINE wrap #-}++-- | Combinator for the @xmlns@ attribute.+--+-- Example:+--+-- > div <! xmlns "bar" $ "Hello."+--+-- Result:+--+-- > <div xmlns="bar">Hello.</div>+--+xmlns :: AttributeValue -- ^ Attribute value.+ -> Attribute -- ^ Resulting attribute.+xmlns = attribute " xmlns=\""+{-# INLINE xmlns #-}
+ src/Text/Blaze/Internal.hs view
@@ -0,0 +1,324 @@+{-# LANGUAGE OverloadedStrings, GeneralizedNewtypeDeriving, Rank2Types,+ FlexibleInstances #-}+-- | The BlazeHtml core, consisting of functions that offer the power to+-- generate custom HTML elements. It also offers user-centric functions, which+-- are exposed through 'Text.Blaze'.+--+module Text.Blaze.Internal+ (+ -- * Important types.+ Html+ , Tag+ , Attribute+ , AttributeValue++ -- * Creating custom tags and attributes.+ , parent+ , leaf+ , open+ , attribute+ , dataAttribute++ -- * Converting values to HTML.+ , text+ , preEscapedText+ , string+ , preEscapedString+ , showHtml+ , preEscapedShowHtml++ -- * Inserting literal 'ByteString's.+ , unsafeByteString++ -- * Converting values to tags.+ , textTag+ , stringTag++ -- * Converting values to attribute values.+ , textValue+ , preEscapedTextValue+ , stringValue+ , preEscapedStringValue++ -- * Setting attributes+ , (!)++ -- * Rendering HTML.+ , renderHtml+ ) where++import Data.Monoid (Monoid, mappend, mempty, mconcat)++import Data.ByteString.Char8 (ByteString)+import qualified Data.ByteString as S+import qualified Data.ByteString.Lazy as L+import Data.Text (Text)+import GHC.Exts (IsString (..))++import Text.Blaze.Internal.Utf8Builder (Utf8Builder)+import qualified Text.Blaze.Internal.Utf8Builder as B+import qualified Text.Blaze.Internal.Utf8BuilderHtml as B++-- | The core HTML datatype.+--+newtype Html a = Html+ { -- | Function to extract the 'Builder'.+ unHtml :: Utf8Builder -> Utf8Builder+ }++-- | Type for an HTML tag. This can be seen as an internal string type used by+-- BlazeHtml.+--+newtype Tag = Tag { unTag :: Utf8Builder }+ deriving (Monoid)++-- | Type for an attribute.+--+newtype Attribute = Attribute (forall a. Html a -> Html a)++-- | The type for the value part of an attribute.+--+newtype AttributeValue = AttributeValue { attributeValue :: Utf8Builder }+ deriving (Monoid)++instance Monoid (Html a) where+ mempty = Html $ \_ -> mempty+ {-# INLINE mempty #-}+ --SM: Note for the benchmarks: We should test which multi-`mappend`+ --versions are faster: right or left-associative ones. Then we can register+ --a rewrite rule taking care of that. I actually guess that this may be one+ --of the reasons accounting for the speed differences between monadic+ --syntax and monoid syntax: the rewrite rules for monadic syntax bring the+ --`>>=` into the better form which results in a better form for `mappend`.+ (Html h1) `mappend` (Html h2) = Html $ \attrs ->+ h1 attrs `mappend` h2 attrs+ {-# INLINE mappend #-}+ mconcat hs = Html $ \attrs ->+ foldr mappend mempty $ map (flip unHtml attrs) hs+ {-# INLINE mconcat #-}++instance Monad Html where+ return _ = mempty+ {-# INLINE return #-}+ (Html h1) >> (Html h2) = Html $+ \attrs -> h1 attrs `mappend` h2 attrs+ {-# INLINE (>>) #-}+ h1 >>= f = h1 >> f (error "_|_")+ {-# INLINE (>>=) #-}++instance IsString (Html a) where+ fromString = string+ {-# INLINE fromString #-}++instance IsString Tag where+ fromString = stringTag+ {-# INLINE fromString #-}++instance IsString AttributeValue where+ fromString = stringValue+ {-# INLINE fromString #-}++-- | Create an HTML parent element.+--+parent :: Tag -- ^ Start of the open HTML tag.+ -> Tag -- ^ The closing tag.+ -> Html a -- ^ Inner HTML, to place in this element.+ -> Html b -- ^ Resulting HTML.+parent begin end = \inner -> Html $ \attrs ->+ unTag begin+ `mappend` attrs+ `mappend` B.fromChar '>'+ `mappend` unHtml inner mempty+ `mappend` unTag end+{-# INLINE parent #-}++-- | Create an HTML leaf element.+--+leaf :: Tag -- ^ Start of the open HTML tag.+ -> Html a -- ^ Resulting HTML.+leaf begin = Html $ \attrs ->+ unTag begin+ `mappend` attrs+ `mappend` end+ where+ end :: Utf8Builder+ end = B.optimizePiece $ B.fromText $ " />"+ {-# INLINE end #-}+{-# INLINE leaf #-}++-- | Produce an open tag. This can be used for open tags in HTML 4.01, like+-- for example @<br>@.+--+open :: Tag -- ^ Start of the open HTML tag.+ -> Html a -- ^ Resulting HTML.+open begin = Html $ \attrs ->+ unTag begin+ `mappend` attrs+ `mappend` B.fromChar '>'+{-# INLINE open #-}++-- | Create an HTML attribute that can be applied to an HTML element later using+-- the '!' operator.+--+attribute :: Tag -- ^ Shared key string for the HTML attribute.+ -> AttributeValue -- ^ Value for the HTML attribute.+ -> Attribute -- ^ Resulting HTML attribute.+attribute key value = Attribute $ \(Html h) -> Html $ \attrs ->+ h $ attrs `mappend` unTag key+ `mappend` attributeValue value+ `mappend` B.fromChar '"'+{-# INLINE 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 BlazeHtml using this funcion. The above fragment could+-- be described using BlazeHtml with:+--+-- > p ! dataAttribute "foo" "bar" $ "Hello."+--+dataAttribute :: Tag -- ^ Name of the attribute.+ -> AttributeValue -- ^ Value for the attribute.+ -> Attribute -- ^ Resulting HTML attribute.+dataAttribute tag = attribute (" data-" `mappend` tag `mappend` "=\"")+{-# INLINE dataAttribute #-}++class Attributable h where+ -- | 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>+ --+ (!) :: h -> Attribute -> h++instance Attributable (Html a) where+ h ! (Attribute f) = f h+ {-# INLINE (!) #-}++instance Attributable (Html a -> Html b) where+ h ! (Attribute f) = f . h+ {-# INLINE (!) #-}++-- | Render text. Functions like these can be used to supply content in HTML.+--+text :: Text -- ^ Text to render.+ -> Html a -- ^ Resulting HTML fragment.+text = Html . const . B.escapeHtmlFromText+{-# INLINE text #-}++-- | Render text without escaping.+--+preEscapedText :: Text -- ^ Text to insert.+ -> Html a -- Resulting HTML fragment.+preEscapedText = Html . const . B.fromText+{-# INLINE preEscapedText #-}++-- | Create an HTML snippet from a 'String'.+--+string :: String -- ^ String to insert.+ -> Html a -- ^ Resulting HTML fragment.+string = Html . const . B.escapeHtmlFromString+{-# INLINE string #-}++-- | Create an HTML snippet from a 'String' without escaping+--+preEscapedString :: String -> Html a+preEscapedString = Html . const . B.fromString+{-# INLINE preEscapedString #-}++-- | Create an HTML snippet from a datatype that instantiates 'Show'.+--+showHtml :: Show a+ => a -- ^ Value to insert.+ -> Html b -- ^ Resulting HTML fragment.+showHtml = string . show+{-# INLINE showHtml #-}++-- | Create an HTML snippet from a datatype that instantiates 'Show'. This+-- function will not do any HTML entity escaping.+--+preEscapedShowHtml :: Show a+ => a -- ^ Value to insert.+ -> Html b -- ^ Resulting HTML fragment.+preEscapedShowHtml = preEscapedString . show+{-# INLINE preEscapedShowHtml #-}++-- | 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 -- ^ Value to insert.+ -> Html a -- ^ Resulting HTML fragment.+unsafeByteString = Html . const . B.unsafeFromByteString+{-# INLINE unsafeByteString #-}++-- | Create a tag from a 'Text' value. A tag is a string used to denote a+-- certain HTML element, for example @img@.+--+-- This is only useful if you want to create custom HTML combinators.+--+textTag :: Text -- ^ 'Text' for the tag.+ -> Tag -- ^ Resulting tag.+textTag = Tag . B.optimizePiece . B.fromText+{-# INLINE textTag #-}++-- | Create a tag from a 'String' value. For more information, see 'textTag'.+--+stringTag :: String -- ^ 'String' for the tag.+ -> Tag -- ^ Resulting tag.+stringTag = Tag . B.optimizePiece . B.fromString+{-# INLINE stringTag #-}++-- | Render an attribute value from 'Text'.+--+textValue :: Text -- ^ The actual value.+ -> AttributeValue -- ^ Resulting attribute value.+textValue = AttributeValue . B.escapeHtmlFromText+{-# INLINE textValue #-}++-- | Render an attribute value from 'Text' without escaping.+--+preEscapedTextValue :: Text -- ^ Text to insert.+ -> AttributeValue -- Resulting HTML fragment.+preEscapedTextValue = AttributeValue . B.fromText+{-# INLINE preEscapedTextValue #-}++-- | Create an attribute value from a 'String'.+--+stringValue :: String -> AttributeValue+stringValue = AttributeValue . B.escapeHtmlFromString+{-# INLINE stringValue #-}++-- | Create an attribute value from a 'String' without escaping.+--+preEscapedStringValue :: String -> AttributeValue+preEscapedStringValue = AttributeValue . B.fromString+{-# INLINE preEscapedStringValue #-}++-- | /O(n)./ Render the HTML fragment to lazy 'L.ByteString'.+--+renderHtml :: Html a -- ^ Document to render.+ -> L.ByteString -- ^ Resulting output.+renderHtml = B.toLazyByteString . flip unHtml mempty+{-# INLINE renderHtml #-}
+ src/Text/Blaze/Internal/Utf8Builder.hs view
@@ -0,0 +1,220 @@+{-# LANGUAGE GeneralizedNewtypeDeriving, BangPatterns #-}+-- | A module for efficiently constructing a 'Builder'. This module offers more+-- functions than the standard ones, optimized for HTML generation.+--+--+-- SM: General remark: Try to split it into Utf8 specific parts and a+-- HtmlBuilder using it. Essentially, a UTF-8 builder is a Text builder that+-- uses UTF-8 for its internal representation. The Text builder from Tom+-- Harper would then be called Utf16Builder. They should offer exactly the+-- same interface (except perhaps for the extraction functions.)+--+module Text.Blaze.Internal.Utf8Builder + ( + -- * The Utf8Builder type.+ Utf8Builder++ -- * Creating Builders from various text representations.+ , fromChar+ , fromText+ , fromString++ -- * Creating Builders from ByteStrings.+ , unsafeFromByteString++ -- * Transformations on the builder.+ , optimizePiece++ -- * Extracting the value from the builder.+ , toLazyByteString+ , toText++ -- * Internal functions to extend the builder.+ -- ** The write type.+ , Write+ , fromUnsafeWrite+ , optimizeWriteBuilder+ , writeList++ -- ** Functions to create a write.+ , writeChar+ , writeByteString+ ) where++import Foreign+import Data.Char (ord)+import Data.Monoid (Monoid (..))+import Prelude hiding (quot)++import Debug.Trace (trace)+import Data.Binary.Builder (Builder)+import qualified Data.Binary.Builder as B+import qualified Data.ByteString as S+import qualified Data.ByteString.Internal as S+import qualified Data.ByteString.Lazy as L+import Data.Text (Text)+import qualified Data.Text as T+import qualified Data.Text.Encoding as T++-- | A newtype definition for the UTF-8 builder monoid.+newtype Utf8Builder = Utf8Builder Builder+ deriving (Monoid)++-- | /O(1)./ Convert a Haskell character to a 'Utf8Builder', without doing any+-- escaping.+--+fromChar :: Char -> Utf8Builder+fromChar = fromUnsafeWrite . writeChar++-- | /O(n)./ Convert a 'Text' value to a 'Utf8Builder'. This function will not+-- do any HTML escaping.+--+fromText :: Text -> Utf8Builder+fromText text = fromUnsafeWrite $+ T.foldl (\w c -> w `mappend` writeChar c) mempty text++-- | /O(n)./ Convert a Haskell 'String' to a builder. Unlike 'fromHtmlString',+-- this function will not do any escaping.+--+fromString :: String -> Utf8Builder+fromString = writeList writeChar+ -- fromUnsafeWrite $+ -- foldl (\w c -> w `mappend` writeChar c) mempty string+++-- | /O(n)./ A Builder taking a 'S.ByteString`, copying it. This function is+-- considered unsafe, as a `S.ByteString` can contain invalid UTF-8 bytes, so+-- you chould use it with caution. This function should perform better when+-- dealing with small strings than the fromByteString function from Builder.+--+unsafeFromByteString :: S.ByteString -> Utf8Builder+unsafeFromByteString = fromUnsafeWrite . writeByteString++-- | /O(n)./ Optimize a small builder. This function has an initial speed+-- penalty, but will speed up later calls of the optimized builder piece. This+-- speedup will only work well for small builders (less than 1k characters).+--+optimizePiece :: Utf8Builder -> Utf8Builder+optimizePiece = fromUnsafeWrite . optimizeWriteBuilder+{-# INLINE optimizePiece #-}++-- | /O(n)./ Convert the builder to a 'L.ByteString'.+--+toLazyByteString :: Utf8Builder -> L.ByteString+toLazyByteString (Utf8Builder builder) = B.toLazyByteString builder++-- | /O(n)./ Convert the builder to a 'Text' value. Please note that this+-- function is a lot slower than the 'toLazyByteString' function.+--+toText :: Utf8Builder -> Text+toText = T.concat . map T.decodeUtf8 . L.toChunks . toLazyByteString++-- | Abstract representation of a write action to the internal buffer.+--+data Write = Write+ {-# UNPACK #-} !Int+ (Ptr Word8 -> IO ())++-- Create a monoid interface for the write actions.+instance Monoid Write where+ mempty = Write 0 (const $ return ())+ {-# INLINE mempty #-}+ mappend (Write l1 f1) (Write l2 f2) =+ Write (l1 + l2) (\ptr -> f1 ptr >> f2 (ptr `plusPtr` l1))+ {-# INLINE mappend #-}++-- INV: The writes must be smaller than the default buffer size.+--+-- SM: Note that moving the control flow away from the Builder will give us the+-- next level of speed. This way we have simple tail-recursive functions+-- consuming data and filling the buffer.+writeList :: (a -> Write) -> [a] -> Utf8Builder+writeList f xs0 = Utf8Builder $ B.fillBuffer (go xs0 0)+ where+ go [] !w !l !p = return (w, Nothing) -- here should come the call to the next filler.+ go xs@(x:xs') !w !l !p = case f x of+ Write n g + | n <= l -> do+ g p+ go xs' (w+n) (l-n) (p `plusPtr` n)+ | otherwise ->+ return (w, Just (B.forceNewBuffer `mappend` B.fillBuffer (go xs 0)))+ {-# INLINE go #-}+{-# INLINE writeList #-}++-- | Create a builder from a write.+--+fromUnsafeWrite :: Write -- ^ Write to execute.+ -> Utf8Builder -- ^ Resulting builder.+fromUnsafeWrite (Write l f) = Utf8Builder $ B.fromUnsafeWrite l f +{-# INLINE fromUnsafeWrite #-}++-- | Optimize a small builder to a write operation.+--+optimizeWriteBuilder :: Utf8Builder -- ^ Small builder to optimize.+ -> Write -- ^ Resulting write.+optimizeWriteBuilder = writeByteString . mconcat . L.toChunks . toLazyByteString+{-# INLINE optimizeWriteBuilder #-}++-- | Write a 'S.ByteString' to the builder.+--+writeByteString :: S.ByteString -- ^ ByteString to write.+ -> Write -- ^ Resulting write.+writeByteString byteString = Write l f+ where+ (fptr, o, l) = S.toForeignPtr byteString+ f dst = do copyBytes dst (unsafeForeignPtrToPtr fptr `plusPtr` o) l+ touchForeignPtr fptr+ {-# INLINE f #-}+{-# INLINE writeByteString #-}++-- | Write a Unicode character, encoding it as UTF-8.+--+writeChar :: Char -- ^ Character to write.+ -> Write -- ^ Resulting write.+writeChar = encodeCharUtf8 f1 f2 f3 f4+ where+ f1 x = Write 1 $ \ptr -> poke ptr x++ f2 x1 x2 = Write 2 $ \ptr -> do poke ptr x1+ poke (ptr `plusPtr` 1) x2++ f3 x1 x2 x3 = Write 3 $ \ptr -> do poke ptr x1+ poke (ptr `plusPtr` 1) x2+ poke (ptr `plusPtr` 2) x3++ f4 x1 x2 x3 x4 = Write 4 $ \ptr -> do poke ptr x1+ poke (ptr `plusPtr` 1) x2+ poke (ptr `plusPtr` 2) x3+ poke (ptr `plusPtr` 3) x4+{-# INLINE writeChar #-}++-- | Encode a Unicode character to another datatype, using UTF-8. This function+-- acts as an abstract way of encoding characters, as it is unaware of what+-- needs to happen with the resulting bytes: you have to specify functions to+-- deal with those.+--+encodeCharUtf8 :: (Word8 -> a) -- ^ 1-byte UTF-8.+ -> (Word8 -> Word8 -> a) -- ^ 2-byte UTF-8.+ -> (Word8 -> Word8 -> Word8 -> a) -- ^ 3-byte UTF-8.+ -> (Word8 -> Word8 -> Word8 -> Word8 -> a) -- ^ 4-byte UTF-8.+ -> Char -- ^ Input 'Char'.+ -> a -- ^ Result.+encodeCharUtf8 f1 f2 f3 f4 c = case ord c of+ x | x <= 0xFF -> f1 $ fromIntegral x+ | x <= 0x07FF ->+ let x1 = fromIntegral $ (x `shiftR` 6) + 0xC0+ x2 = fromIntegral $ (x .&. 0x3F) + 0x80+ in f2 x1 x2+ | x <= 0xFFFF ->+ let x1 = fromIntegral $ (x `shiftR` 12) + 0xE0+ x2 = fromIntegral $ ((x `shiftR` 6) .&. 0x3F) + 0x80+ x3 = fromIntegral $ (x .&. 0x3F) + 0x80+ in f3 x1 x2 x3+ | otherwise ->+ let x1 = fromIntegral $ (x `shiftR` 18) + 0xF0+ x2 = fromIntegral $ ((x `shiftR` 12) .&. 0x3F) + 0x80+ x3 = fromIntegral $ ((x `shiftR` 6) .&. 0x3F) + 0x80+ x4 = fromIntegral $ (x .&. 0x3F) + 0x80+ in f4 x1 x2 x3 x4+{-# INLINE encodeCharUtf8 #-}
+ src/Text/Blaze/Internal/Utf8BuilderHtml.hs view
@@ -0,0 +1,56 @@+{-# LANGUAGE OverloadedStrings #-}+-- | Module extending 'Utf8Builder' with HTML-specific functions.+--+module Text.Blaze.Internal.Utf8BuilderHtml+ ( + -- * Creating builders with HTML escaping.+ escapeHtmlFromChar+ , escapeHtmlFromText+ , escapeHtmlFromString+ ) where++import Data.Monoid (Monoid (..))++import Data.Text (Text)+import qualified Data.Text as T++import Text.Blaze.Internal.Utf8Builder++-- | /O(1)./ Convert a Haskell character to a 'Utf8Builder'.+--+escapeHtmlFromChar :: Char -> Utf8Builder+escapeHtmlFromChar = fromUnsafeWrite . escapeHtmlWriteChar++-- | /O(n)./ Convert a 'Text' value to a 'Utf8Builder'. This function does+-- proper HTML escaping.+--+escapeHtmlFromText :: Text -> Utf8Builder+escapeHtmlFromText text = fromUnsafeWrite $+ T.foldl (\w c -> w `mappend` escapeHtmlWriteChar c) mempty text+--+--SM: The above construction is going to kill you (in terms of memory and+--latency) if the text is too long. Could you ensure that the text is written+--chunkwise? Perhaps, by first breaking the Builder abstraction again and+--inlining the check for enough free memory into the loop. The basic check+--should be equally expensive as summing up the length.+--++-- | /O(n)./ Convert a Haskell 'String' to a 'Utf8Builder'. This function does+-- proper escaping for HTML entities.+--+escapeHtmlFromString :: String -> Utf8Builder+escapeHtmlFromString = writeList escapeHtmlWriteChar+ -- fromUnsafeWrite $ + -- foldl (\w c -> w `mappend` escapeHtmlWriteChar c) mempty string++-- | Write an unicode character to a 'Builder', doing HTML escaping.+--+escapeHtmlWriteChar :: Char -- ^ Character to write.+ -> Write -- ^ Resulting write.+escapeHtmlWriteChar '<' = optimizeWriteBuilder $ fromText "<"+escapeHtmlWriteChar '>' = optimizeWriteBuilder $ fromText ">"+escapeHtmlWriteChar '&' = optimizeWriteBuilder $ fromText "&"+escapeHtmlWriteChar '"' = optimizeWriteBuilder $ fromText """+escapeHtmlWriteChar '\'' = optimizeWriteBuilder $ fromText "'"+escapeHtmlWriteChar c = writeChar c+{-# INLINE escapeHtmlWriteChar #-}