Text.XHtml.Frameset

xhtml-3000.2.2.1: An XHTML combinator library

Safe Haskell | Safe
Language | Haskell2010

Text.XHtml.Frameset

Contents

- Data types
- Classes
- Primitives and basic combinators
- Rendering
- Elements in XHTML Strict
- Extra elements in XHTML Frameset
- Attributes in XHTML Strict
- Extra attributes in XHTML Frameset
- Converting strings to HTML
- Html abbreviations
- Hotlinks
- Lists
- Forms

Description

Produces XHTML 1.0 Frameset.

Synopsis

- data Html
- data HtmlAttr
- class HTML a where
  - toHtml :: a -> Html
  - toHtmlFromList :: [a] -> Html
- class ADDATTRS a where
  - (!) :: a -> [HtmlAttr] -> a
- 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 :: String -> Html -> Html
- itag :: String -> Html
- htmlAttrPair :: HtmlAttr -> (String, String)
- emptyAttr :: String -> HtmlAttr
- intAttr :: String -> Int -> HtmlAttr
- strAttr :: String -> String -> HtmlAttr
- htmlAttr :: String -> Html -> HtmlAttr
- primHtml :: String -> Html
- showHtml :: HTML html => html -> String
- renderHtml :: HTML html => 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
- frame :: Html -> Html
- frameset :: Html -> Html
- noframes :: 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
- frameborder :: Int -> HtmlAttr
- marginheight :: Int -> HtmlAttr
- marginwidth :: Int -> HtmlAttr
- noresize :: HtmlAttr
- scrolling :: 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 #

Instances

Show Html # |
Instance details Defined in Text.XHtml.Internals Methods showsPrec :: Int -> Html -> ShowS Source # show :: Html -> String Source # showList :: [Html] -> ShowS Source #
Semigroup Html # | Since: xhtml-3000.2.2
Instance details Defined in Text.XHtml.Internals Methods (<>) :: Html -> Html -> Html Source # sconcat :: NonEmpty Html -> Html Source # stimes :: Integral b => b -> Html -> Html Source #
Monoid Html # |
Instance details Defined in Text.XHtml.Internals Methods mempty :: Html Source # mappend :: Html -> Html -> Html Source # mconcat :: [Html] -> Html Source #
CHANGEATTRS Html # |
Instance details Defined in Text.XHtml.Internals Methods changeAttrs :: Html -> ([HtmlAttr] -> [HtmlAttr]) -> Html #
ADDATTRS Html # |
Instance details Defined in Text.XHtml.Internals Methods (!) :: Html -> [HtmlAttr] -> Html #
HTML Html # |
Instance details Defined in Text.XHtml.Internals Methods toHtml :: Html -> Html # toHtmlFromList :: [Html] -> Html #
HTMLTABLE Html # |
Instance details Defined in Text.XHtml.Table Methods cell :: Html -> HtmlTable #

data HtmlAttr #

Attributes with name and value.

Instances

Show HtmlAttr # |
Instance details Defined in Text.XHtml.Internals Methods showsPrec :: Int -> HtmlAttr -> ShowS Source # show :: HtmlAttr -> String Source # showList :: [HtmlAttr] -> ShowS Source #

# 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 # |
Instance details Defined in Text.XHtml.Internals Methods toHtml :: Char -> Html # toHtmlFromList :: [Char] -> Html #
HTML Html # |
Instance details Defined in Text.XHtml.Internals Methods toHtml :: Html -> Html # toHtmlFromList :: [Html] -> Html #
HTML HotLink # |
Instance details Defined in Text.XHtml.Extras Methods toHtml :: HotLink -> Html # toHtmlFromList :: [HotLink] -> Html #
HTML HtmlTable # |
Instance details Defined in Text.XHtml.Table Methods toHtml :: HtmlTable -> Html # toHtmlFromList :: [HtmlTable] -> Html #
HTML HtmlTree # |
Instance details Defined in Text.XHtml.Debug Methods toHtml :: HtmlTree -> Html # toHtmlFromList :: [HtmlTree] -> Html #
HTML a => HTML [a] # |
Instance details Defined in Text.XHtml.Internals Methods toHtml :: [a] -> Html # toHtmlFromList :: [[a]] -> Html #
HTML a => HTML (Maybe a) # |
Instance details Defined in Text.XHtml.Internals Methods toHtml :: Maybe a -> Html # toHtmlFromList :: [Maybe a] -> Html #

class ADDATTRS a where #

Methods

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

Instances

ADDATTRS Html # |
Instance details Defined in Text.XHtml.Internals Methods (!) :: Html -> [HtmlAttr] -> Html #
ADDATTRS HotLink # |
Instance details Defined in Text.XHtml.Extras Methods (!) :: HotLink -> [HtmlAttr] -> HotLink #
ADDATTRS b => ADDATTRS (a -> b) # |
Instance details Defined in Text.XHtml.Internals Methods (!) :: (a -> b) -> [HtmlAttr] -> a -> b #

class CHANGEATTRS a where #

CHANGEATTRS is a more expressive alternative to ADDATTRS

Methods

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

Instances

CHANGEATTRS Html # |
Instance details Defined in Text.XHtml.Internals Methods changeAttrs :: Html -> ([HtmlAttr] -> [HtmlAttr]) -> Html #
CHANGEATTRS b => CHANGEATTRS (a -> b) # |
Instance details Defined in Text.XHtml.Internals 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.

htmlAttrPair :: HtmlAttr -> (String, String) #

emptyAttr :: String -> HtmlAttr #

intAttr :: String -> Int -> HtmlAttr #

strAttr :: String -> String -> HtmlAttr #

htmlAttr :: String -> Html -> HtmlAttr #

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 #

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 #

# Extra elements in XHTML Frameset

frame :: Html -> Html #

frameset :: Html -> Html #

noframes :: Html -> Html #

# Attributes in XHTML Strict

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 #

# Extra attributes in XHTML Frameset

frameborder :: Int -> HtmlAttr #

marginheight :: Int -> HtmlAttr #

marginwidth :: Int -> HtmlAttr #

noresize :: HtmlAttr #

scrolling :: String -> HtmlAttr #

# 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

primHtmlChar :: String -> Html #

copyright :: Html #

Copyright sign.

spaceHtml :: Html #

Non-breaking space.

bullet :: Html #

p :: Html -> Html #

Same as `paragraph`.

# Hotlinks

type URL = String #

data HotLink #

Constructors

HotLink |
Fields hotLinkURL :: URL hotLinkContents :: Html hotLinkAttributes :: [HtmlAttr]

Instances

Show HotLink # |
Instance details Defined in Text.XHtml.Extras Methods showsPrec :: Int -> HotLink -> ShowS Source # show :: HotLink -> String Source # showList :: [HotLink] -> ShowS Source #
ADDATTRS HotLink # |
Instance details Defined in Text.XHtml.Extras Methods (!) :: HotLink -> [HtmlAttr] -> HotLink #
HTML HotLink # |
Instance details Defined in Text.XHtml.Extras Methods toHtml :: HotLink -> Html # toHtmlFromList :: [HotLink] -> Html #

hotlink :: URL -> Html -> HotLink #

# Lists

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

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

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

# Forms

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 #

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

gui :: String -> Html -> Html #