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

PortabilityGHC
Stabilityexperimental
Maintaineralasdair.armstrong@googlemail.com

Text.XHtmlCombinators

Contents

Description

 

Synopsis

Types

XHtml

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

type XHtmlT t x = XHtmlMT t x ()Source

data Page Source

Instances

type Attrs = [Attr]Source

data Attr Source

Instances

Element Types

Misc Element Types

List Element Types

Field Element Types

Table Element Types

Combinators

html'Source

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 cSource

Document Head

meta'Source

Arguments

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

Required content attribute.

-> Attrs 
-> XHtmlT t HeadContent 

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

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

style'Source

Arguments

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

Required type attribute.

-> Attrs 
-> Text 
-> XHtmlT t HeadContent 

script'Source

Arguments

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

Required type attribute.

-> Attrs 
-> Text 
-> XHtmlT t HeadContent 

Document Body

Paragraphs

Headings

Lists

Definition Lists

Address

Horizontal Rule

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

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

Preformatted Text

Block-like Quotes

Inserted/Deleted Text

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

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

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

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

The Anchor Element

Inline Elements

bdo'Source

Arguments

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

Required language direction code.

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

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

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

Object

Images

img'Source

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 cSource

Client-side image maps

map'Source

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 cSource

area'Source

Arguments

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

Required alt attribute.

-> Attrs 
-> XHtmlT t MapContent 

Forms

form'Source

Arguments

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

Required action attribute.

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

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

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

optgroup'Source

Arguments

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

Required label attribute.

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

textarea'Source

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 cSource

Tables

Rendering

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

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.