xhtml-3000.3.0.0: An XHTML combinator library
Safe HaskellSafe-Inferred
LanguageHaskell2010

Text.XHtml.Transitional

Description

Produces XHTML 1.0 Transitional.

Synopsis

Data types

data Html Source #

Instances

Instances details
Monoid Html Source # 
Instance details

Defined in Text.XHtml.Internals

Methods

mempty :: Html #

mappend :: Html -> Html -> Html #

mconcat :: [Html] -> Html #

Semigroup Html Source #

Since: 3000.2.2

Instance details

Defined in Text.XHtml.Internals

Methods

(<>) :: Html -> Html -> Html #

sconcat :: NonEmpty Html -> Html #

stimes :: Integral b => b -> Html -> Html #

Show Html Source # 
Instance details

Defined in Text.XHtml.Internals

Methods

showsPrec :: Int -> Html -> ShowS #

show :: Html -> String #

showList :: [Html] -> ShowS #

ADDATTRS Html Source # 
Instance details

Defined in Text.XHtml.Internals

Methods

(!) :: Html -> [HtmlAttr] -> Html Source #

CHANGEATTRS Html Source # 
Instance details

Defined in Text.XHtml.Internals

Methods

changeAttrs :: Html -> ([HtmlAttr] -> [HtmlAttr]) -> Html Source #

HTML Html Source # 
Instance details

Defined in Text.XHtml.Internals

HTMLTABLE Html Source # 
Instance details

Defined in Text.XHtml.Table

Methods

cell :: Html -> HtmlTable Source #

data HtmlAttr Source #

Attributes with name and value.

Instances

Instances details
Show HtmlAttr Source # 
Instance details

Defined in Text.XHtml.Internals

Classes

class HTML a where Source #

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.

Minimal complete definition

toHtml

Methods

toHtml :: a -> Html Source #

toHtmlFromList :: [a] -> Html Source #

Instances

Instances details
HTML Text Source # 
Instance details

Defined in Text.XHtml.Internals

HTML Text Source # 
Instance details

Defined in Text.XHtml.Internals

HTML HtmlTree Source # 
Instance details

Defined in Text.XHtml.Debug

HTML HotLink Source # 
Instance details

Defined in Text.XHtml.Extras

HTML Html Source # 
Instance details

Defined in Text.XHtml.Internals

HTML HtmlTable Source # 
Instance details

Defined in Text.XHtml.Table

HTML Char Source # 
Instance details

Defined in Text.XHtml.Internals

HTML a => HTML (Maybe a) Source # 
Instance details

Defined in Text.XHtml.Internals

HTML a => HTML [a] Source # 
Instance details

Defined in Text.XHtml.Internals

Methods

toHtml :: [a] -> Html Source #

toHtmlFromList :: [[a]] -> Html Source #

class ADDATTRS a where Source #

Methods

(!) :: a -> [HtmlAttr] -> a infixl 8 Source #

Instances

Instances details
ADDATTRS HotLink Source # 
Instance details

Defined in Text.XHtml.Extras

Methods

(!) :: HotLink -> [HtmlAttr] -> HotLink Source #

ADDATTRS Html Source # 
Instance details

Defined in Text.XHtml.Internals

Methods

(!) :: Html -> [HtmlAttr] -> Html Source #

ADDATTRS b => ADDATTRS (a -> b) Source # 
Instance details

Defined in Text.XHtml.Internals

Methods

(!) :: (a -> b) -> [HtmlAttr] -> a -> b Source #

class CHANGEATTRS a where Source #

CHANGEATTRS is a more expressive alternative to ADDATTRS

Methods

changeAttrs :: a -> ([HtmlAttr] -> [HtmlAttr]) -> a Source #

Instances

Instances details
CHANGEATTRS Html Source # 
Instance details

Defined in Text.XHtml.Internals

Methods

changeAttrs :: Html -> ([HtmlAttr] -> [HtmlAttr]) -> Html Source #

CHANGEATTRS b => CHANGEATTRS (a -> b) Source # 
Instance details

Defined in Text.XHtml.Internals

Methods

changeAttrs :: (a -> b) -> ([HtmlAttr] -> [HtmlAttr]) -> a -> b Source #

Primitives and basic combinators

(<<) infixr 7 Source #

Arguments

:: HTML a 
=> (Html -> b)

Parent

-> a

Child

-> b 

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.

noHtml :: Html Source #

An empty piece of 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.

tag Source #

Arguments

:: Builder

Element name

-> Html

Element contents

-> Html 

Constructs an element with a custom name.

itag :: Builder -> 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 <.

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.

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.

Re-exports

data Builder #

Builders denote sequences of bytes. They are Monoids where mempty is the zero-length sequence and mappend is concatenation, which runs in O(1).

Instances

Instances details
Monoid Builder 
Instance details

Defined in Data.ByteString.Builder.Internal

Semigroup Builder 
Instance details

Defined in Data.ByteString.Builder.Internal

Elements in XHTML Strict

Extra elements in XHTML Frameset

Extra elements in XHTML Transitional

applet :: Html -> Html Source #

Deprecated: This element is deprecated in XHTML 1.0

basefont :: Html Source #

Deprecated: This element is deprecated in XHTML 1.0

center :: Html -> Html Source #

Deprecated: This element is deprecated in XHTML 1.0

dir :: Html -> Html Source #

Deprecated: This element is deprecated in XHTML 1.0

font :: Html -> Html Source #

Deprecated: This element is deprecated in XHTML 1.0

isindex :: Html Source #

Deprecated: This element is deprecated in XHTML 1.0

themenu :: Html -> Html Source #

Deprecated: This element is deprecated in XHTML 1.0

strike :: Html -> Html Source #

Deprecated: This element is deprecated in XHTML 1.0

underline :: Html -> Html Source #

Deprecated: This element is deprecated in XHTML 1.0

Attributes in XHTML Strict

Extra attributes in XHTML Frameset

Extra attributes in XHTML Transitional

alink :: LText -> HtmlAttr Source #

Deprecated: This attribute is deprecated in XHTML 1.0

background :: LText -> HtmlAttr Source #

Deprecated: This attribute is deprecated in XHTML 1.0

bgcolor :: LText -> HtmlAttr Source #

Deprecated: This attribute is deprecated in XHTML 1.0

clear :: LText -> HtmlAttr Source #

Deprecated: This attribute is deprecated in XHTML 1.0

code :: LText -> HtmlAttr Source #

Deprecated: This attribute is deprecated in XHTML 1.0

color :: LText -> HtmlAttr Source #

Deprecated: This attribute is deprecated in XHTML 1.0

compact :: HtmlAttr Source #

Deprecated: This attribute is deprecated in XHTML 1.0

face :: LText -> HtmlAttr Source #

Deprecated: This attribute is deprecated in XHTML 1.0

hspace :: Int -> HtmlAttr Source #

Deprecated: This attribute is deprecated in XHTML 1.0

link :: LText -> HtmlAttr Source #

Deprecated: This attribute is deprecated in XHTML 1.0

noshade :: HtmlAttr Source #

Deprecated: This attribute is deprecated in XHTML 1.0

nowrap :: HtmlAttr Source #

Deprecated: This attribute is deprecated in XHTML 1.0

start :: Int -> HtmlAttr Source #

Deprecated: This attribute is deprecated in XHTML 1.0

text :: LText -> HtmlAttr Source #

Deprecated: This attribute is deprecated in XHTML 1.0

version :: LText -> HtmlAttr Source #

Deprecated: This attribute is deprecated in XHTML 1.0

vlink :: LText -> HtmlAttr Source #

Deprecated: This attribute is deprecated in XHTML 1.0

vspace :: Int -> HtmlAttr Source #

Deprecated: This attribute is deprecated in XHTML 1.0

Html colors

aqua :: LText Source #

Deprecated: The use of color attibutes is deprecated in XHTML 1.0

black :: LText Source #

Deprecated: The use of color attibutes is deprecated in XHTML 1.0

blue :: LText Source #

Deprecated: The use of color attibutes is deprecated in XHTML 1.0

fuchsia :: LText Source #

Deprecated: The use of color attibutes is deprecated in XHTML 1.0

gray :: LText Source #

Deprecated: The use of color attibutes is deprecated in XHTML 1.0

green :: LText Source #

Deprecated: The use of color attibutes is deprecated in XHTML 1.0

lime :: LText Source #

Deprecated: The use of color attibutes is deprecated in XHTML 1.0

maroon :: LText Source #

Deprecated: The use of color attibutes is deprecated in XHTML 1.0

navy :: LText Source #

Deprecated: The use of color attibutes is deprecated in XHTML 1.0

olive :: LText Source #

Deprecated: The use of color attibutes is deprecated in XHTML 1.0

purple :: LText Source #

Deprecated: The use of color attibutes is deprecated in XHTML 1.0

red :: LText Source #

Deprecated: The use of color attibutes is deprecated in XHTML 1.0

silver :: LText Source #

Deprecated: The use of color attibutes is deprecated in XHTML 1.0

teal :: LText Source #

Deprecated: The use of color attibutes is deprecated in XHTML 1.0

yellow :: LText Source #

Deprecated: The use of color attibutes is deprecated in XHTML 1.0

white :: LText Source #

Deprecated: The use of color attibutes is deprecated in XHTML 1.0

Converting strings to HTML

stringToHtml :: String -> Html Source #

Convert a String to Html, converting characters that need to be escaped to HTML entities.

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

copyright :: Html Source #

Copyright sign.

spaceHtml :: Html Source #

Non-breaking space.

p :: Html -> Html Source #

Same as paragraph.

Hotlinks

type URL = Text Source #

data HotLink Source #

Instances

Lists

ordList :: HTML a => [a] -> Html Source #

unordList :: HTML a => [a] -> Html Source #

defList :: (HTML a, HTML b) => [(a, b)] -> Html Source #

Forms

menu :: Text -> [Html] -> Html Source #

Deprecated: menu generates strange XHTML, and is not flexible enough. Roll your own that suits your needs.