module Text.XHtml.Strict (
Html, HtmlAttr,
HTML(..), ADDATTRS(..),
(<<), concatHtml, (+++),
noHtml, isNoHtml, tag, itag,
emptyAttr, intAttr, strAttr, htmlAttr,
primHtml, stringToHtmlString,
docType,
showHtml, renderHtml, renderHtmlWithLanguage, prettyHtml,
showHtmlFragment, renderHtmlFragment, prettyHtmlFragment,
module Text.XHtml.Strict.Elements,
module Text.XHtml.Strict.Attributes,
module Text.XHtml.Extras
) where
import Text.XHtml.Internals
import Text.XHtml.Strict.Elements
import Text.XHtml.Strict.Attributes
import Text.XHtml.Extras
docType = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\""
++ " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">"
showHtml :: HTML html => html -> String
showHtml = showHtmlInternal docType
renderHtml :: HTML html => html -> String
renderHtml = renderHtmlInternal docType
renderHtmlWithLanguage :: HTML html
=> String
-> html
-> String
renderHtmlWithLanguage l theHtml =
docType ++ "\n" ++ renderHtmlFragment code ++ "\n"
where
code = tag "html" ! [ strAttr "xmlns" "http://www.w3.org/1999/xhtml"
, strAttr "lang" l
, strAttr "xml:lang" l
] << theHtml
prettyHtml :: HTML html => html -> String
prettyHtml = prettyHtmlInternal docType