Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Produces XHTML 1.0 Strict.
Synopsis
- data Html
- data HtmlAttr
- class HTML a where
- toHtml :: a -> Html
- toHtmlFromList :: [a] -> Html
- class ADDATTRS a where
- class CHANGEATTRS a where
- changeAttrs :: a -> ([HtmlAttr] -> [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 :: ByteString -> Html -> Html
- itag :: ByteString -> Html
- htmlAttrPair :: HtmlAttr -> (Builder, Builder)
- emptyAttr :: Builder -> HtmlAttr
- intAttr :: Builder -> Int -> HtmlAttr
- strAttr :: Builder -> Text -> HtmlAttr
- htmlAttr :: Builder -> Html -> HtmlAttr
- primHtml :: String -> Html
- stringToHtmlString :: String -> Builder
- docType :: Builder
- showHtml :: HTML html => html -> Builder
- renderHtml :: HTML html => html -> Builder
- renderHtmlWithLanguage :: HTML html => Text -> html -> Builder
- prettyHtml :: HTML html => html -> String
- showHtmlFragment :: HTML html => html -> Builder
- renderHtmlFragment :: HTML html => html -> Builder
- 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 :: Text -> HtmlAttr
- align :: Text -> HtmlAttr
- alt :: Text -> HtmlAttr
- altcode :: Text -> HtmlAttr
- archive :: Text -> HtmlAttr
- base :: Text -> HtmlAttr
- border :: Int -> HtmlAttr
- bordercolor :: Text -> HtmlAttr
- cellpadding :: Int -> HtmlAttr
- cellspacing :: Int -> HtmlAttr
- checked :: HtmlAttr
- codebase :: Text -> HtmlAttr
- cols :: Text -> HtmlAttr
- colspan :: Int -> HtmlAttr
- content :: Text -> HtmlAttr
- coords :: Text -> HtmlAttr
- disabled :: HtmlAttr
- enctype :: Text -> HtmlAttr
- height :: Text -> HtmlAttr
- href :: Text -> HtmlAttr
- hreflang :: Text -> HtmlAttr
- httpequiv :: Text -> HtmlAttr
- identifier :: Text -> HtmlAttr
- ismap :: HtmlAttr
- lang :: Text -> HtmlAttr
- maxlength :: Int -> HtmlAttr
- method :: Text -> HtmlAttr
- multiple :: HtmlAttr
- name :: Text -> HtmlAttr
- nohref :: HtmlAttr
- rel :: Text -> HtmlAttr
- rev :: Text -> HtmlAttr
- rows :: Text -> HtmlAttr
- rowspan :: Int -> HtmlAttr
- rules :: Text -> HtmlAttr
- selected :: HtmlAttr
- shape :: Text -> HtmlAttr
- size :: Text -> HtmlAttr
- src :: Text -> HtmlAttr
- theclass :: Text -> HtmlAttr
- thefor :: Text -> HtmlAttr
- thestyle :: Text -> HtmlAttr
- thetype :: Text -> HtmlAttr
- title :: Text -> HtmlAttr
- usemap :: Text -> HtmlAttr
- valign :: Text -> HtmlAttr
- value :: Text -> HtmlAttr
- width :: Text -> HtmlAttr
- stringToHtml :: String -> Html
- lineToHtml :: String -> Html
- linesToHtml :: [String] -> Html
- primHtmlChar :: String -> Html
- copyright :: Html
- spaceHtml :: Html
- bullet :: Html
- p :: Html -> Html
- type URL = Text
- data HotLink = HotLink {}
- hotlink :: URL -> Html -> HotLink
- ordList :: HTML a => [a] -> Html
- unordList :: HTML a => [a] -> Html
- defList :: (HTML a, HTML b) => [(a, b)] -> Html
- widget :: Text -> Text -> [HtmlAttr] -> Html
- checkbox :: Text -> Text -> Html
- hidden :: Text -> Text -> Html
- radio :: Text -> Text -> Html
- reset :: Text -> Text -> Html
- submit :: Text -> Text -> Html
- password :: Text -> Html
- textfield :: Text -> Html
- afile :: Text -> Html
- clickmap :: Text -> Html
- menu :: Text -> [Html] -> Html
- gui :: Text -> Html -> Html
Data types
Attributes with name and value.
Classes
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.
Instances
HTML ByteString Source # | |
Defined in Text.XHtml.Internals toHtml :: ByteString -> Html Source # toHtmlFromList :: [ByteString] -> Html Source # | |
HTML ByteString Source # | |
Defined in Text.XHtml.Internals toHtml :: ByteString -> Html Source # toHtmlFromList :: [ByteString] -> Html Source # | |
HTML Text Source # | |
HTML Text Source # | |
HTML HtmlTree Source # | |
HTML HotLink Source # | |
HTML Html Source # | |
HTML HtmlTable Source # | |
HTML Char Source # | |
HTML a => HTML (Maybe a) Source # | |
HTML a => HTML [a] Source # | |
Defined in Text.XHtml.Internals |
class CHANGEATTRS a where Source #
CHANGEATTRS is a more expressive alternative to ADDATTRS
changeAttrs :: a -> ([HtmlAttr] -> [HtmlAttr]) -> a Source #
Instances
CHANGEATTRS Html Source # | |
Defined in Text.XHtml.Internals | |
CHANGEATTRS b => CHANGEATTRS (a -> b) Source # | |
Defined in Text.XHtml.Internals changeAttrs :: (a -> b) -> ([HtmlAttr] -> [HtmlAttr]) -> a -> b Source # |
Primitives and basic combinators
Put something inside an HTML element.
concatHtml :: HTML a => [a] -> Html Source #
(+++) :: (HTML a, HTML b) => a -> b -> Html infixr 2 Source #
Create a piece of HTML which is the concatenation of two things which can be made into HTML.
isNoHtml :: Html -> Bool Source #
Checks whether the given piece of HTML is empty. This materializes the list, so it's not great to do this a bunch.
:: ByteString | Element name |
-> Html | Element contents |
-> Html |
Constructs an element with a custom name.
itag :: ByteString -> Html Source #
Constructs an element with a custom name, and without any children.
primHtml :: String -> Html Source #
This is not processed for special chars.
use stringToHtml or lineToHtml instead, for user strings,
because they understand special chars, like
.<
stringToHtmlString :: String -> Builder Source #
Processing Strings into Html friendly things.
Rendering
showHtml :: HTML html => html -> Builder Source #
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 output is quite unreadable.
renderHtml :: HTML html => html -> Builder Source #
Outputs indented HTML. Because space matters in HTML, the output is quite messy.
renderHtmlWithLanguage Source #
:: HTML html | |
=> Text | The code of the "dominant" language of the webpage. |
-> html | All the |
-> Builder |
Outputs indented XHTML. Because space matters in HTML, the output is quite messy.
prettyHtml :: HTML html => html -> String Source #
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 -> Builder Source #
Render a piece of HTML without adding a DOCTYPE declaration or root element. Does not add any extra whitespace.
renderHtmlFragment :: HTML html => html -> Builder Source #
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 -> String Source #
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
blockquote :: Html -> Html Source #
Attributes in XHTML Strict
bordercolor :: Text -> HtmlAttr Source #
cellpadding :: Int -> HtmlAttr Source #
cellspacing :: Int -> HtmlAttr Source #
identifier :: Text -> HtmlAttr Source #
Converting strings to HTML
stringToHtml :: String -> Html Source #
lineToHtml :: String -> Html Source #
This converts a string, but keeps spaces as non-line-breakable.
linesToHtml :: [String] -> Html Source #
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 -> Html Source #
Hotlinks
HotLink | |
|