xhtml-combinators-0.2.2: Fast and easy to use XHTML combinators.

Copyright(c) Alasdair Armstrong 2010
LicenseBSD-style
Maintaineralasdair.armstrong@googlemail.com
Stabilityexperimental
PortabilityGHC
Safe HaskellNone
LanguageHaskell98

Text.XHtmlCombinators

Contents

Description

 

Synopsis

Types

XHtml

type XHtmlMT t x a = WriterT (Seq x) t a

type XHtmlT t x = XHtmlMT t x ()

type XHtml x = XHtmlT Identity x

data Page

Instances

class CData c

Minimal complete definition

cdata

type Attrs = [Attr]

data Attr

Instances

Element Types

class Block c

Minimal complete definition

block

Misc Element Types

List Element Types

Field Element Types

Table Element Types

Combinators

html'

Arguments

:: (Functor t, Monad t) 
=> Bool

True for XML declaration, false to omit.

-> Attrs 
-> XHtmlT t TopLevelContent 
-> XHtmlT t Page 

text :: (Functor t, Monad t, CData c) => Text -> XHtmlT t c

empty :: Monad t => XHtmlT t x

Document Head

meta'

Arguments

:: (Functor t, Monad t) 
=> Text

Required content attribute.

-> Attrs 
-> XHtmlT t HeadContent 

link :: (Functor t, Monad t) => XHtmlT t HeadContent

link is a bit useless without any attributes, but it's included anyway for consistency reasons. As are several other similar elements.

style'

Arguments

:: (Functor t, Monad t) 
=> Text

Required type attribute.

-> Attrs 
-> Text 
-> XHtmlT t HeadContent 

script'

Arguments

:: (Functor t, Monad t) 
=> Text

Required type attribute.

-> Attrs 
-> Text 
-> XHtmlT t HeadContent 

Document Body

div' :: (Functor t, Monad t, Block c) => Attrs -> XHtmlT t FlowContent -> XHtmlT t c

div_ :: (Functor t, Monad t, Block c) => XHtmlT t FlowContent -> XHtmlT t c

Paragraphs

p' :: (Functor t, Monad t, Block c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c

p :: (Functor t, Monad t, Block c) => XHtmlT t InlineContent -> XHtmlT t c

Headings

h1' :: (Functor t, Monad t, Block c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c

h1 :: (Functor t, Monad t, Block c) => XHtmlT t InlineContent -> XHtmlT t c

h2' :: (Functor t, Monad t, Block c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c

h2 :: (Functor t, Monad t, Block c) => XHtmlT t InlineContent -> XHtmlT t c

h3' :: (Functor t, Monad t, Block c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c

h3 :: (Functor t, Monad t, Block c) => XHtmlT t InlineContent -> XHtmlT t c

h4' :: (Functor t, Monad t, Block c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c

h4 :: (Functor t, Monad t, Block c) => XHtmlT t InlineContent -> XHtmlT t c

h5' :: (Functor t, Monad t, Block c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c

h5 :: (Functor t, Monad t, Block c) => XHtmlT t InlineContent -> XHtmlT t c

h6' :: (Functor t, Monad t, Block c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c

h6 :: (Functor t, Monad t, Block c) => XHtmlT t InlineContent -> XHtmlT t c

Lists

ul' :: (Functor t, Monad t, Block c) => Attrs -> XHtmlT t ListContent -> XHtmlT t c

ul :: (Functor t, Monad t, Block c) => XHtmlT t ListContent -> XHtmlT t c

ol' :: (Functor t, Monad t, Block c) => Attrs -> XHtmlT t ListContent -> XHtmlT t c

ol :: (Functor t, Monad t, Block c) => XHtmlT t ListContent -> XHtmlT t c

Definition Lists

Address

Horizontal Rule

hr' :: (Functor t, Monad t, Block c) => Attrs -> XHtmlT t c

hr :: (Functor t, Monad t, Block c) => XHtmlT t c

Preformatted Text

pre' :: (Functor t, Monad t, Block c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c

pre :: (Functor t, Monad t, Block c) => XHtmlT t InlineContent -> XHtmlT t c

Block-like Quotes

Inserted/Deleted Text

ins' :: (Functor t, Monad t) => (Flow c, Content c) => Attrs -> XHtmlT t c -> XHtmlT t c

ins :: (Functor t, Monad t) => (Flow c, Content c) => XHtmlT t c -> XHtmlT t c

del' :: (Functor t, Monad t) => (Flow c, Content c) => Attrs -> XHtmlT t c -> XHtmlT t c

del :: (Functor t, Monad t) => (Flow c, Content c) => XHtmlT t c -> XHtmlT t c

The Anchor Element

a' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c

a :: (Functor t, Monad t, Inline c) => XHtmlT t InlineContent -> XHtmlT t c

Inline Elements

bdo'

Arguments

:: (Functor t, Monad t, Inline c) 
=> Text

Required language direction code.

-> Attrs 
-> XHtmlT t InlineContent 
-> XHtmlT t c 

bdo :: (Functor t, Monad t, Inline c) => Text -> XHtmlT t InlineContent -> XHtmlT t c

br' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t c

br :: (Functor t, Monad t, Inline c) => XHtmlT t c

em' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c

em :: (Functor t, Monad t, Inline c) => XHtmlT t InlineContent -> XHtmlT t c

dfn' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c

dfn :: (Functor t, Monad t, Inline c) => XHtmlT t InlineContent -> XHtmlT t c

kbd' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c

kbd :: (Functor t, Monad t, Inline c) => XHtmlT t InlineContent -> XHtmlT t c

var' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c

var :: (Functor t, Monad t, Inline c) => XHtmlT t InlineContent -> XHtmlT t c

q' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c

q :: (Functor t, Monad t, Inline c) => XHtmlT t InlineContent -> XHtmlT t c

sub' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c

sub :: (Functor t, Monad t, Inline c) => XHtmlT t InlineContent -> XHtmlT t c

tt' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c

tt :: (Functor t, Monad t, Inline c) => XHtmlT t InlineContent -> XHtmlT t c

i' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c

i :: (Functor t, Monad t, Inline c) => XHtmlT t InlineContent -> XHtmlT t c

b' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c

b :: (Functor t, Monad t, Inline c) => XHtmlT t InlineContent -> XHtmlT t c

big' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c

big :: (Functor t, Monad t, Inline c) => XHtmlT t InlineContent -> XHtmlT t c

Object

Images

img'

Arguments

:: (Functor t, Monad t, Flow c) 
=> Text

Required src attribute.

-> Text

Required alt attribute.

-> Attrs 
-> XHtmlT t c 

img :: (Functor t, Monad t, Flow c) => Text -> Text -> XHtmlT t c

Client-side image maps

map'

Arguments

:: (Functor t, Monad t, Flow c) 
=> Text

Required id attribute.

-> Attrs 
-> XHtmlT t MapContent 
-> XHtmlT t c 

map_ :: (Functor t, Monad t, Flow c) => Text -> XHtmlT t MapContent -> XHtmlT t c

area'

Arguments

:: (Functor t, Monad t) 
=> Text

Required alt attribute.

-> Attrs 
-> XHtmlT t MapContent 

Forms

form'

Arguments

:: (Functor t, Monad t, Block c) 
=> Text

Required action attribute.

-> Attrs 
-> XHtmlT t FlowContent 
-> XHtmlT t c 

form :: (Functor t, Monad t, Block c) => Text -> XHtmlT t FlowContent -> XHtmlT t c

input' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t c

input :: (Functor t, Monad t, Inline c) => XHtmlT t c

optgroup'

Arguments

:: (Functor t, Monad t) 
=> Text

Required label attribute.

-> Attrs 
-> XHtmlT t OptionContent 
-> XHtmlT t OptionContent 

textarea'

Arguments

:: (Functor t, Monad t, Inline c) 
=> Int

Required rows attribute.

-> Int

Required cols attribute.

-> Attrs 
-> Text 
-> XHtmlT t c 

textarea :: (Functor t, Monad t, Inline c) => Int -> Int -> Text -> XHtmlT t c

Tables

Rendering

render :: Content c => XHtml c -> Text

renderT :: (Functor t, Monad t, Content c) => XHtmlT t c -> t Text

Quickly render a xhtml page to text.

This function will render the entire page on a single line, which is somewhat unreadable. On the plus side, it's relatively fast.