module Blaze.Html5
(
module Text.Blaze
,module Text.Blaze.Html5
,module Text.Blaze.Html5.Attributes
,Attributable
,(!.)
,(!#)
,linesToHtml
,htmlIntercalate
,htmlCommasAnd
,htmlCommas)
where
import Data.Monoid
import Text.Blaze
import Text.Blaze.Html5 hiding (map,style,title)
import qualified Text.Blaze.Html5.Attributes as A
import Text.Blaze.Html5.Attributes hiding (span,label,cite,form,summary,min)
import Text.Blaze.Internal (Attributable)
(!.) :: (Attributable h) => h -> AttributeValue -> h
e !. className = e ! A.class_ className
(!#) :: (Attributable h) => h -> AttributeValue -> h
e !# idName = e ! A.id idName
linesToHtml :: [Html] -> Html
linesToHtml = htmlIntercalate br
htmlIntercalate :: Html -> [Html] -> Html
htmlIntercalate _ [x] = x
htmlIntercalate sep (x:xs) = do x; sep; htmlIntercalate sep xs
htmlIntercalate _ [] = mempty
htmlCommasAnd :: [Html] -> Html
htmlCommasAnd [x] = x
htmlCommasAnd [x,y] = do x; " and "; y
htmlCommasAnd (x:xs) = do x; ", "; htmlCommasAnd xs
htmlCommasAnd [] = mempty
htmlCommas :: [Html] -> Html
htmlCommas = htmlIntercalate ", "