xhtml-3000.2.0.0: An XHTML combinator librarySource codeContentsIndex
Text.XHtml.Strict
Contents
Data types
Classes
Primitives and basic combinators
Rendering
Elements in XHTML Strict
Attributes in XHTML Strict
Converting strings to HTML
Html abbreviations
Hotlinks
Lists
Forms
Description
Produces XHTML 1.0 Strict.
Synopsis
data Html
data HtmlAttr
class HTML a where
toHtml :: a -> Html
toHtmlFromList :: [a] -> Html
class ADDATTRS a where
(!) :: a -> [HtmlAttr] -> a
(<<) :: HTML a => (Html -> b) -> a -> b
concatHtml :: HTML a => [a] -> Html
(+++) :: (HTML a, HTML b) => a -> b -> Html
noHtml :: Html
isNoHtml :: Html -> Bool
tag :: String -> Html -> Html
itag :: String -> Html
emptyAttr :: String -> HtmlAttr
intAttr :: String -> Int -> HtmlAttr
strAttr :: String -> String -> HtmlAttr
htmlAttr :: String -> Html -> HtmlAttr
primHtml :: String -> Html
stringToHtmlString :: String -> String
showHtml :: HTML html => html -> String
renderHtml :: HTML html => html -> String
renderHtmlWithLanguage :: HTML html => String -> html -> String
prettyHtml :: HTML html => html -> String
showHtmlFragment :: HTML html => html -> String
renderHtmlFragment :: HTML html => html -> String
prettyHtmlFragment :: HTML html => html -> String
abbr :: Html -> Html
acronym :: Html -> Html
address :: Html -> Html
anchor :: Html -> Html
area :: Html
bdo :: Html -> Html
big :: Html -> Html
blockquote :: Html -> Html
body :: Html -> Html
bold :: Html -> Html
br :: Html
button :: Html -> Html
caption :: Html -> Html
cite :: Html -> Html
col :: Html -> Html
colgroup :: Html -> Html
del :: Html -> Html
ddef :: Html -> Html
define :: Html -> Html
dlist :: Html -> Html
dterm :: Html -> Html
emphasize :: Html -> Html
fieldset :: Html -> Html
form :: Html -> Html
h1 :: Html -> Html
h2 :: Html -> Html
h3 :: Html -> Html
h4 :: Html -> Html
h5 :: Html -> Html
h6 :: Html -> Html
header :: Html -> Html
hr :: Html
image :: Html
input :: Html
ins :: Html -> Html
italics :: Html -> Html
keyboard :: Html -> Html
label :: Html -> Html
legend :: Html -> Html
li :: Html -> Html
meta :: Html
noscript :: Html -> Html
object :: Html -> Html
olist :: Html -> Html
optgroup :: Html -> Html
option :: Html -> Html
paragraph :: Html -> Html
param :: Html
pre :: Html -> Html
quote :: Html -> Html
sample :: Html -> Html
script :: Html -> Html
select :: Html -> Html
small :: Html -> Html
strong :: Html -> Html
style :: Html -> Html
sub :: Html -> Html
sup :: Html -> Html
table :: Html -> Html
tbody :: Html -> Html
td :: Html -> Html
textarea :: Html -> Html
tfoot :: Html -> Html
th :: Html -> Html
thead :: Html -> Html
thebase :: Html
thecode :: Html -> Html
thediv :: Html -> Html
thehtml :: Html -> Html
thelink :: Html -> Html
themap :: Html -> Html
thespan :: Html -> Html
thetitle :: Html -> Html
tr :: Html -> Html
tt :: Html -> Html
ulist :: Html -> Html
variable :: Html -> Html
action :: String -> HtmlAttr
align :: String -> HtmlAttr
alt :: String -> HtmlAttr
altcode :: String -> HtmlAttr
archive :: String -> HtmlAttr
base :: String -> HtmlAttr
border :: Int -> HtmlAttr
bordercolor :: String -> HtmlAttr
cellpadding :: Int -> HtmlAttr
cellspacing :: Int -> HtmlAttr
checked :: HtmlAttr
codebase :: String -> HtmlAttr
cols :: String -> HtmlAttr
colspan :: Int -> HtmlAttr
content :: String -> HtmlAttr
coords :: String -> HtmlAttr
disabled :: HtmlAttr
enctype :: String -> HtmlAttr
height :: String -> HtmlAttr
href :: String -> HtmlAttr
hreflang :: String -> HtmlAttr
httpequiv :: String -> HtmlAttr
identifier :: String -> HtmlAttr
ismap :: HtmlAttr
lang :: String -> HtmlAttr
maxlength :: Int -> HtmlAttr
method :: String -> HtmlAttr
multiple :: HtmlAttr
name :: String -> HtmlAttr
nohref :: HtmlAttr
rel :: String -> HtmlAttr
rev :: String -> HtmlAttr
rows :: String -> HtmlAttr
rowspan :: Int -> HtmlAttr
rules :: String -> HtmlAttr
selected :: HtmlAttr
shape :: String -> HtmlAttr
size :: String -> HtmlAttr
src :: String -> HtmlAttr
theclass :: String -> HtmlAttr
thefor :: String -> HtmlAttr
thestyle :: String -> HtmlAttr
thetype :: String -> HtmlAttr
title :: String -> HtmlAttr
usemap :: String -> HtmlAttr
valign :: String -> HtmlAttr
value :: String -> HtmlAttr
width :: String -> HtmlAttr
stringToHtml :: String -> Html
lineToHtml :: String -> Html
linesToHtml :: [String] -> Html
primHtmlChar :: String -> Html
copyright :: Html
spaceHtml :: Html
bullet :: Html
p :: Html -> Html
type URL = String
data HotLink = HotLink {
hotLinkURL :: URL
hotLinkContents :: Html
hotLinkAttributes :: [HtmlAttr]
}
hotlink :: URL -> Html -> HotLink
ordList :: HTML a => [a] -> Html
unordList :: HTML a => [a] -> Html
defList :: (HTML a, HTML b) => [(a, b)] -> Html
widget :: String -> String -> [HtmlAttr] -> Html
checkbox :: String -> String -> Html
hidden :: String -> String -> Html
radio :: String -> String -> Html
reset :: String -> String -> Html
submit :: String -> String -> Html
password :: String -> Html
textfield :: String -> Html
afile :: String -> Html
clickmap :: String -> Html
menu :: String -> [Html] -> Html
gui :: String -> Html -> Html
Data types
data Html Source
show/hide Instances
data HtmlAttr Source
Attributes with name and value.
show/hide Instances
Classes
class HTML a whereSource
HTML is the class of things that can be validly put inside an HTML tag. So this can be one or more Html elements, or a String, for example.
Methods
toHtml :: a -> HtmlSource
toHtmlFromList :: [a] -> HtmlSource
show/hide Instances
class ADDATTRS a whereSource
Methods
(!) :: a -> [HtmlAttr] -> aSource
show/hide Instances
Primitives and basic combinators
(<<)Source
:: HTML a
=> (Html -> b)Parent
-> aChild
-> b
Put something inside an HTML element.
concatHtml :: HTML a => [a] -> HtmlSource
(+++) :: (HTML a, HTML b) => a -> b -> HtmlSource
Create a piece of HTML which is the concatenation of two things which can be made into HTML.
noHtml :: HtmlSource
An empty piece of HTML.
isNoHtml :: Html -> BoolSource
Checks whether the given piece of HTML is empty.
tagSource
:: StringElement name
-> HtmlElement contents
-> Html
Constructs an element with a custom name.
itag :: String -> HtmlSource
Constructs an element with a custom name, and without any children.
emptyAttr :: String -> HtmlAttrSource
intAttr :: String -> Int -> HtmlAttrSource
strAttr :: String -> String -> HtmlAttrSource
htmlAttr :: String -> Html -> HtmlAttrSource
primHtml :: String -> HtmlSource
This is not processed for special chars. use stringToHtml or lineToHtml instead, for user strings, because they understand special chars, like <.
stringToHtmlString :: String -> StringSource
Processing Strings into Html friendly things.
Rendering
showHtml :: HTML html => html -> StringSource
Output the HTML without adding newlines or spaces within the markup. This should be the most time and space efficient way to render HTML, though the ouput is quite unreadable.
renderHtml :: HTML html => html -> StringSource
Outputs indented HTML. Because space matters in HTML, the output is quite messy.
renderHtmlWithLanguageSource
:: HTML html
=> StringThe code of the dominant language of the webpage.
-> htmlAll the Html, including a header.
-> String
Outputs indented XHTML. Because space matters in HTML, the output is quite messy.
prettyHtml :: HTML html => html -> StringSource
Outputs indented HTML, with indentation inside elements. This can change the meaning of the HTML document, and is mostly useful for debugging the HTML output. The implementation is inefficient, and you are normally better off using showHtml or renderHtml.
showHtmlFragment :: HTML html => html -> StringSource
Render a piece of HTML without adding a DOCTYPE declaration or root element. Does not add any extra whitespace.
renderHtmlFragment :: HTML html => html -> StringSource
Render a piece of indented HTML without adding a DOCTYPE declaration or root element. Only adds whitespace where it does not change the meaning of the document.
prettyHtmlFragment :: HTML html => html -> StringSource
Render a piece of indented HTML without adding a DOCTYPE declaration or a root element. The indentation is done inside elements. This can change the meaning of the HTML document, and is mostly useful for debugging the HTML output. The implementation is inefficient, and you are normally better off using showHtmlFragment or renderHtmlFragment.
Elements in XHTML Strict
abbr :: Html -> HtmlSource
acronym :: Html -> HtmlSource
address :: Html -> HtmlSource
anchor :: Html -> HtmlSource
area :: HtmlSource
bdo :: Html -> HtmlSource
big :: Html -> HtmlSource
blockquote :: Html -> HtmlSource
body :: Html -> HtmlSource
bold :: Html -> HtmlSource
br :: HtmlSource
button :: Html -> HtmlSource
caption :: Html -> HtmlSource
cite :: Html -> HtmlSource
col :: Html -> HtmlSource
colgroup :: Html -> HtmlSource
del :: Html -> HtmlSource
ddef :: Html -> HtmlSource
define :: Html -> HtmlSource
dlist :: Html -> HtmlSource
dterm :: Html -> HtmlSource
emphasize :: Html -> HtmlSource
fieldset :: Html -> HtmlSource
form :: Html -> HtmlSource
h1 :: Html -> HtmlSource
h2 :: Html -> HtmlSource
h3 :: Html -> HtmlSource
h4 :: Html -> HtmlSource
h5 :: Html -> HtmlSource
h6 :: Html -> HtmlSource
header :: Html -> HtmlSource
hr :: HtmlSource
image :: HtmlSource
input :: HtmlSource
ins :: Html -> HtmlSource
italics :: Html -> HtmlSource
keyboard :: Html -> HtmlSource
label :: Html -> HtmlSource
legend :: Html -> HtmlSource
li :: Html -> HtmlSource
meta :: HtmlSource
noscript :: Html -> HtmlSource
object :: Html -> HtmlSource
olist :: Html -> HtmlSource
optgroup :: Html -> HtmlSource
option :: Html -> HtmlSource
paragraph :: Html -> HtmlSource
param :: HtmlSource
pre :: Html -> HtmlSource
quote :: Html -> HtmlSource
sample :: Html -> HtmlSource
script :: Html -> HtmlSource
select :: Html -> HtmlSource
small :: Html -> HtmlSource
strong :: Html -> HtmlSource
style :: Html -> HtmlSource
sub :: Html -> HtmlSource
sup :: Html -> HtmlSource
table :: Html -> HtmlSource
tbody :: Html -> HtmlSource
td :: Html -> HtmlSource
textarea :: Html -> HtmlSource
tfoot :: Html -> HtmlSource
th :: Html -> HtmlSource
thead :: Html -> HtmlSource
thebase :: HtmlSource
thecode :: Html -> HtmlSource
thediv :: Html -> HtmlSource
thehtml :: Html -> HtmlSource
thelink :: Html -> HtmlSource
themap :: Html -> HtmlSource
thespan :: Html -> HtmlSource
thetitle :: Html -> HtmlSource
tr :: Html -> HtmlSource
tt :: Html -> HtmlSource
ulist :: Html -> HtmlSource
variable :: Html -> HtmlSource
Attributes in XHTML Strict
action :: String -> HtmlAttrSource
align :: String -> HtmlAttrSource
alt :: String -> HtmlAttrSource
altcode :: String -> HtmlAttrSource
archive :: String -> HtmlAttrSource
base :: String -> HtmlAttrSource
border :: Int -> HtmlAttrSource
bordercolor :: String -> HtmlAttrSource
cellpadding :: Int -> HtmlAttrSource
cellspacing :: Int -> HtmlAttrSource
checked :: HtmlAttrSource
codebase :: String -> HtmlAttrSource
cols :: String -> HtmlAttrSource
colspan :: Int -> HtmlAttrSource
content :: String -> HtmlAttrSource
coords :: String -> HtmlAttrSource
disabled :: HtmlAttrSource
enctype :: String -> HtmlAttrSource
height :: String -> HtmlAttrSource
href :: String -> HtmlAttrSource
hreflang :: String -> HtmlAttrSource
httpequiv :: String -> HtmlAttrSource
identifier :: String -> HtmlAttrSource
ismap :: HtmlAttrSource
lang :: String -> HtmlAttrSource
maxlength :: Int -> HtmlAttrSource
method :: String -> HtmlAttrSource
multiple :: HtmlAttrSource
name :: String -> HtmlAttrSource
nohref :: HtmlAttrSource
rel :: String -> HtmlAttrSource
rev :: String -> HtmlAttrSource
rows :: String -> HtmlAttrSource
rowspan :: Int -> HtmlAttrSource
rules :: String -> HtmlAttrSource
selected :: HtmlAttrSource
shape :: String -> HtmlAttrSource
size :: String -> HtmlAttrSource
src :: String -> HtmlAttrSource
theclass :: String -> HtmlAttrSource
thefor :: String -> HtmlAttrSource
thestyle :: String -> HtmlAttrSource
thetype :: String -> HtmlAttrSource
title :: String -> HtmlAttrSource
usemap :: String -> HtmlAttrSource
valign :: String -> HtmlAttrSource
value :: String -> HtmlAttrSource
width :: String -> HtmlAttrSource
Converting strings to HTML
stringToHtml :: String -> HtmlSource
Convert a String to Html, converting characters that need to be escaped to HTML entities.
lineToHtml :: String -> HtmlSource
This converts a string, but keeps spaces as non-line-breakable.
linesToHtml :: [String] -> HtmlSource
This converts a string, but keeps spaces as non-line-breakable, and adds line breaks between each of the strings in the input list.
Html abbreviations
primHtmlChar :: String -> HtmlSource
copyright :: HtmlSource
Copyright sign.
spaceHtml :: HtmlSource
Non-breaking space.
bullet :: HtmlSource
p :: Html -> HtmlSource
Same as paragraph.
Hotlinks
type URL = StringSource
data HotLink Source
Constructors
HotLink
hotLinkURL :: URL
hotLinkContents :: Html
hotLinkAttributes :: [HtmlAttr]
show/hide Instances
hotlink :: URL -> Html -> HotLinkSource
Lists
ordList :: HTML a => [a] -> HtmlSource
unordList :: HTML a => [a] -> HtmlSource
defList :: (HTML a, HTML b) => [(a, b)] -> HtmlSource
Forms
widget :: String -> String -> [HtmlAttr] -> HtmlSource
checkbox :: String -> String -> HtmlSource
hidden :: String -> String -> HtmlSource
radio :: String -> String -> HtmlSource
reset :: String -> String -> HtmlSource
submit :: String -> String -> HtmlSource
password :: String -> HtmlSource
textfield :: String -> HtmlSource
afile :: String -> HtmlSource
clickmap :: String -> HtmlSource
menu :: String -> [Html] -> HtmlSource
gui :: String -> Html -> HtmlSource
Produced by Haddock version 0.9