blaze-html-contrib-0.2.2: Some contributions to add handy things to blaze html.

Safe HaskellSafe-Infered

Text.Blaze.Extra

Synopsis

Documentation

(!.) :: Attributable h => h -> AttributeValue -> hSource

Add an class to an element.

(!#) :: Attributable h => h -> AttributeValue -> hSource

Add an id to an element.

linesToHtml :: String -> HtmlSource

Render a list of lines (separated by n) to HTML.

htmlIntercalate :: Html -> [Html] -> HtmlSource

Intercalate some HTML.

htmlCommas :: [Html] -> HtmlSource

Make a list of html into a comma separated html.

hrefSet :: URI -> String -> String -> AttributeSource

Set a parameter of a URI, as an attribute.

hrefURI :: URI -> AttributeSource

Provide a URI as an attribute for href.

hrefAssoc :: String -> [(String, String)] -> AttributeSource

Create an href from a path and association list of parameters. Usage:

hrefAssoc "/search" [("query", "foo"), ("mode", "bar")]

Creates: href "/search?query=foo&mode=bar"

css :: AttributeValue -> HtmlSource

Link to a CSS stylesheet.

js :: AttributeValue -> HtmlSource

Link to a javscript file.

linkTo :: AttributeValue -> Html -> HtmlSource

Create a link.

postForm :: String -> Html -> HtmlSource

Create a form with method = "POST" that posts to the given url.