Safe Haskell | None |
---|
A simple library for client-side HTML generation. Compatible with hsx2hs.
- fromStringLit :: String -> String
- data Attr a b = a := b
- class AsChild a
- asChild :: AsChild a => a -> Fay HTML
- class AsAttr a
- asAttr :: Attr String String -> Fay (String, String)
- data HTML
- genElement :: (Maybe String, String) -> [Fay (String, String)] -> [Fay HTML] -> Fay HTML
- renderHTML :: HTML -> Fay JQuery
- alert :: String -> Fay ()
- tr :: [Fay (String, String)] -> [Fay HTML] -> Fay HTML
- td :: [Fay (String, String)] -> [Fay HTML] -> Fay HTML
- span_ :: [Fay (String, String)] -> [Fay HTML] -> Fay HTML
- pcdata :: String -> Fay HTML
- createElement :: String -> Fay Element
- createTextNode :: String -> Fay Element
Documentation
fromStringLit :: String -> StringSource
type class for embedding values as HTML children
since Fay does not yet support type-class methods we have to fake it via the ffi
ADT for HTML
:: (Maybe String, String) | Element name |
-> [Fay (String, String)] | list of attributes |
-> [Fay HTML] | list of children |
-> Fay HTML |
generate an HTML element
renderHTML :: HTML -> Fay JQuerySource
render the HTML
into a JQuery DOM tree. You still need to
append the result somewhere.
NOTE: This function requires jQuery
create a new text node
NOTE: this doesn't really return an Element. It returns a TextNode or something. But fay-jquery only supports the Element type...