module Text.HTML.Moe.Type where
import Data.Default
import Control.Monad.Writer
data Element =
Element
{
name :: String
, attributes :: [Attribute]
, elements :: [Element]
, indent :: Bool
}
| Raw String -- for preformatted html strings, no escape
| Pre String -- for space sensitive tags, textarea/pre
| Data String -- normal string, auto escaped
deriving (Show)
instance Default Element where
def = Element def def def True
data Attribute = Attribute
{
key :: String
, value :: String
}
deriving (Show)
instance Default Attribute where
def = Attribute def def
type MoeUnitT a = Writer [Element] a
type MoeUnit = MoeUnitT ()
type MoeCombinator = [Attribute] -> MoeUnit -> MoeUnit
type MoeCombinator' = MoeUnit -> MoeUnit