xhtml-3000.2.2: An XHTML combinator library

Safe HaskellSafe
LanguageHaskell2010

Text.XHtml.Frameset

Contents

Description

Produces XHTML 1.0 Frameset.

Synopsis

Data types

data Html #

Instances

Show Html # 

Methods

showsPrec :: Int -> Html -> ShowS #

show :: Html -> String #

showList :: [Html] -> ShowS #

Semigroup Html #

Since: 3000.2.2

Methods

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

sconcat :: NonEmpty Html -> Html #

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

Monoid Html # 

Methods

mempty :: Html #

mappend :: Html -> Html -> Html #

mconcat :: [Html] -> Html #

CHANGEATTRS Html # 

Methods

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

ADDATTRS Html # 

Methods

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

HTML Html # 

Methods

toHtml :: Html -> Html #

toHtmlFromList :: [Html] -> Html #

HTMLTABLE Html # 

Methods

cell :: Html -> HtmlTable #

data HtmlAttr #

Attributes with name and value.

Instances

Classes

class HTML a where #

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 #

toHtmlFromList :: [a] -> Html #

Instances

HTML Char # 

Methods

toHtml :: Char -> Html #

toHtmlFromList :: [Char] -> Html #

HTML Html # 

Methods

toHtml :: Html -> Html #

toHtmlFromList :: [Html] -> Html #

HTML HotLink # 
HTML HtmlTable # 
HTML HtmlTree # 
HTML a => HTML [a] # 

Methods

toHtml :: [a] -> Html #

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

HTML a => HTML (Maybe a) # 

Methods

toHtml :: Maybe a -> Html #

toHtmlFromList :: [Maybe a] -> Html #

class ADDATTRS a where #

Minimal complete definition

(!)

Methods

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

Instances

ADDATTRS Html # 

Methods

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

ADDATTRS HotLink # 

Methods

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

ADDATTRS b => ADDATTRS (a -> b) # 

Methods

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

class CHANGEATTRS a where #

CHANGEATTRS is a more expressive alternative to ADDATTRS

Minimal complete definition

changeAttrs

Methods

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

Instances

CHANGEATTRS Html # 

Methods

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

CHANGEATTRS b => CHANGEATTRS (a -> b) # 

Methods

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

Primitives and basic combinators

(<<) infixr 7 #

Arguments

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

Parent

-> a

Child

-> b 

Put something inside an HTML element.

concatHtml :: HTML a => [a] -> Html #

(+++) :: (HTML a, HTML b) => a -> b -> Html infixr 2 #

Create a piece of HTML which is the concatenation of two things which can be made into HTML.

noHtml :: Html #

An empty piece of HTML.

isNoHtml :: Html -> Bool #

Checks whether the given piece of HTML is empty.

tag #

Arguments

:: String

Element name

-> Html

Element contents

-> Html 

Constructs an element with a custom name.

itag :: String -> Html #

Constructs an element with a custom name, and without any children.

primHtml :: String -> Html #

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 -> String #

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 -> String #

Outputs indented HTML. Because space matters in HTML, the output is quite messy.

prettyHtml :: HTML html => html -> String #

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 -> String #

Render a piece of HTML without adding a DOCTYPE declaration or root element. Does not add any extra whitespace.

renderHtmlFragment :: HTML html => html -> String #

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 #

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 -> Html #

bdo :: Html -> Html #

big :: Html -> Html #

body :: Html -> Html #

bold :: Html -> Html #

br :: Html #

cite :: Html -> Html #

col :: Html -> Html #

del :: Html -> Html #

ddef :: Html -> Html #

form :: Html -> Html #

h1 :: Html -> Html #

h2 :: Html -> Html #

h3 :: Html -> Html #

h4 :: Html -> Html #

h5 :: Html -> Html #

h6 :: Html -> Html #

hr :: Html #

ins :: Html -> Html #

li :: Html -> Html #

pre :: Html -> Html #

sub :: Html -> Html #

sup :: Html -> Html #

td :: Html -> Html #

th :: Html -> Html #

tr :: Html -> Html #

tt :: Html -> Html #

Extra elements in XHTML Frameset

Attributes in XHTML Strict

Extra attributes in XHTML Frameset

Converting strings to HTML

stringToHtml :: String -> Html #

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

lineToHtml :: String -> Html #

This converts a string, but keeps spaces as non-line-breakable.

linesToHtml :: [String] -> Html #

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 #

Copyright sign.

spaceHtml :: Html #

Non-breaking space.

p :: Html -> Html #

Same as paragraph.

Hotlinks

type URL = String #

Lists

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

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

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

Forms

menu :: String -> [Html] -> Html #

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

gui :: String -> Html -> Html #