xhtml-combinators 0.2.2 → 0.3
raw patch · 18 files changed
+3419/−2724 lines, 18 files
Files
- src/Text/XHtmlCombinators.hs +2/−117
- src/Text/XHtmlCombinators/Attributes.hs +5/−117
- src/Text/XHtmlCombinators/Attributes/Internal.hs +0/−27
- src/Text/XHtmlCombinators/Attributes/Internal/Safe.hs +0/−28
- src/Text/XHtmlCombinators/Attributes/Safe.hs +0/−133
- src/Text/XHtmlCombinators/Combinators.lhs +0/−1632
- src/Text/XHtmlCombinators/Escape.hs +0/−344
- src/Text/XHtmlCombinators/Extras/Lorem.hs +0/−109
- src/Text/XHtmlCombinators/Frameset.hs +1052/−0
- src/Text/XHtmlCombinators/Frameset/Attributes.hs +126/−0
- src/Text/XHtmlCombinators/Internal.hs +56/−20
- src/Text/XHtmlCombinators/Render.hs +44/−59
- src/Text/XHtmlCombinators/Safe.hs +0/−123
- src/Text/XHtmlCombinators/Strict.hs +877/−0
- src/Text/XHtmlCombinators/Strict/Attributes.hs +101/−0
- src/Text/XHtmlCombinators/Transitional.hs +1019/−0
- src/Text/XHtmlCombinators/Transitional/Attributes.hs +125/−0
- xhtml-combinators.cabal +12/−15
src/Text/XHtmlCombinators.hs view
@@ -7,123 +7,8 @@ -- Portability : GHC module Text.XHtmlCombinators- ( -- * Types- -- ** XHtml- XHtmlMT, XHtmlT, XHtml- , Page- , Content, CData- , Attrs, Attr- -- ** Element Types- , TopLevelContent- , HeadContent- , Flow, FlowContent- , Block, BlockContent- , Inline, InlineContent- -- *** Misc Element Types- , ObjectContent- , MapContent- -- *** List Element Types- , ListContent, DefinitionListContent- -- *** Field Element Types- , FieldSetContent- , OptionContent- -- *** Table Element Types- , Table1Content, Table2Content, Table3Content- , TableColContent- -- * Combinators- , html', html- , text, empty- -- ** Document Head- , head', head_- , title', title- , base', base- , meta', meta- , link', link- , style', style- , script', script- , noscript', noscript- -- ** Document Body- , body', body- , div', div_- -- ** Paragraphs- , p', p- -- ** Headings- , h1', h1, h2', h2, h3', h3- , h4', h4, h5', h5, h6', h6- -- ** Lists- , ul', ul- , ol', ol- , li', li- -- *** Definition Lists- , dl', dl- , dt', dt- , dd', dd- -- ** Address- , address', address- -- ** Horizontal Rule- , hr', hr- -- ** Preformatted Text- , pre', pre- -- ** Block-like Quotes- , blockquote', blockquote- -- ** Inserted/Deleted Text- , ins', ins, del', del- -- ** The Anchor Element- , a', a- -- ** Inline Elements- , span', span_- , bdo', bdo- , br', br- , em', em- , strong', strong- , dfn', dfn- , code', code- , samp', samp- , kbd', kbd- , var', var- , cite', cite- , abbr', abbr- , acronym', acronym- , q', q- , sub', sub- , tt', tt- , i', i- , b', b- , big', big- , small', small- -- ** Object- , object', object, param', param- -- ** Images- , img', img - -- ** Client-side image maps- , map', map_- , area', area- -- ** Forms- , form', form- , label', label- , input', input- , select', select- , optgroup', optgroup- , option', option- , textarea', textarea- , fieldset', fieldset- , legend', legend- , button', button- -- ** Tables- , table', table- , caption', caption- , thead', thead- , tfoot', tfoot- , tbody', tbody- , colgroup', colgroup- , col', col- , tr', tr- , th', th- , td', td- -- * Rendering- , render, renderT+ ( module Text.XHtmlCombinators.Strict ) where -import Text.XHtmlCombinators.Combinators-import Text.XHtmlCombinators.Internal+import Text.XHtmlCombinators.Strict import Text.XHtmlCombinators.Render
src/Text/XHtmlCombinators/Attributes.hs view
@@ -1,125 +1,13 @@-{-# LANGUAGE OverloadedStrings #-}- -- | -- Module : Text.XHtmlCombinators.Attributes--- Copyright : (c) Andy Gill, and the Oregon Graduate Institute of Science and Technology 1999-2001--- (c) Bjorn Bringert 2004-2006--- (c) Alasdair Armstrong 2010+-- Copyright : (c) Alasdair Armstrong 2010 -- License : BSD-style -- Maintainer : alasdair.armstrong@googlemail.com -- Stability : experimental -- Portability : GHC -module Text.XHtmlCombinators.Attributes where--import Data.Text (Text)-import qualified Data.Text as T--import Text.XHtmlCombinators.Internal (Attr (Attr))-import Text.XHtmlCombinators.Attributes.Internal--attr :: Text -> Text -> Attr-attr = Attr---- the following was copied almost verbatim from Bjorn Bringert's xhtml library.--- See: http://hackage.haskell.org/package/xhtml---- TODO: Not all attributes are currently available.--action :: Text -> Attr-align :: Text -> Attr-alt :: Text -> Attr-altcode :: Text -> Attr-archive :: Text -> Attr-base :: Text -> Attr-border :: Int -> Attr-bordercolor :: Text -> Attr-cellpadding :: Int -> Attr-cellspacing :: Int -> Attr-checked :: Attr-codebase :: Text -> Attr-cols :: Text -> Attr-colspan :: Int -> Attr-content :: Text -> Attr-coords :: Text -> Attr-disabled :: Attr-enctype :: Text -> Attr-height :: Text -> Attr-href :: Text -> Attr-hreflang :: Text -> Attr-httpEquiv :: Text -> Attr-id_ :: Text -> Attr-ismap :: Attr-lang :: Text -> Attr-maxlength :: Int -> Attr-method :: Text -> Attr-multiple :: Attr-name :: Text -> Attr-nohref :: Attr-rel :: Text -> Attr-rev :: Text -> Attr-rows :: Text -> Attr-rowspan :: Int -> Attr-rules :: Text -> Attr-selected :: Attr-shape :: Text -> Attr-size :: Text -> Attr-src :: Text -> Attr-class_ :: Text -> Attr-for :: Text -> Attr-style :: Text -> Attr-type_ :: Text -> Attr-title :: Text -> Attr-usemap :: Text -> Attr-valign :: Text -> Attr-value :: Text -> Attr-width :: Text -> Attr+module Text.XHtmlCombinators.Attributes+ ( module Text.XHtmlCombinators.Strict.Attributes+ ) where -action = textAttr "action"-align = textAttr "align"-alt = textAttr "alt"-altcode = textAttr "altcode"-archive = textAttr "archive"-base = textAttr "base"-border = intAttr "border"-bordercolor = textAttr "bordercolor"-cellpadding = intAttr "cellpadding"-cellspacing = intAttr "cellspacing"-checked = emptyAttr "checked"-codebase = textAttr "codebase"-cols = textAttr "cols"-colspan = intAttr "colspan"-content = textAttr "content"-coords = textAttr "coords"-disabled = emptyAttr "disabled"-enctype = textAttr "enctype"-height = textAttr "height"-href = textAttr "href"-hreflang = textAttr "hreflang"-httpEquiv = textAttr "http-equiv"-id_ = textAttr "id"-ismap = emptyAttr "ismap"-lang = textAttr "lang"-maxlength = intAttr "maxlength"-method = textAttr "method"-multiple = emptyAttr "multiple"-name = textAttr "name"-nohref = emptyAttr "nohref"-rel = textAttr "rel"-rev = textAttr "rev"-rows = textAttr "rows"-rowspan = intAttr "rowspan"-rules = textAttr "rules"-selected = emptyAttr "selected"-shape = textAttr "shape"-size = textAttr "size"-src = textAttr "src"-class_ = textAttr "class"-for = textAttr "for"-style = textAttr "style"-type_ = textAttr "type"-title = textAttr "title"-usemap = textAttr "usemap"-valign = textAttr "valign"-value = textAttr "value"-width = textAttr "width"+import Text.XHtmlCombinators.Strict.Attributes
− src/Text/XHtmlCombinators/Attributes/Internal.hs
@@ -1,27 +0,0 @@--- |--- Module : Text.XHtmlCombinators.Attributes--- Copyright : (c) Alasdair Armstrong 2010--- License : BSD-style--- Maintainer : alasdair.armstrong@googlemail.com--- Stability : experimental--- Portability : GHC--module Text.XHtmlCombinators.Attributes.Internal- ( emptyAttr- , intAttr- , textAttr- ) where--import Data.Text (Text)-import qualified Data.Text as T--import Text.XHtmlCombinators.Internal--emptyAttr :: Text -> Attr-emptyAttr name = Attr name name--intAttr :: Text -> Int -> Attr-intAttr name = Attr name . T.pack . show--textAttr :: Text -> Text -> Attr-textAttr name = Attr name
− src/Text/XHtmlCombinators/Attributes/Internal/Safe.hs
@@ -1,28 +0,0 @@--- |--- Module : Text.XHtmlCombinators.Attributes--- Copyright : (c) Alasdair Armstrong 2010--- License : BSD-style--- Maintainer : alasdair.armstrong@googlemail.com--- Stability : experimental--- Portability : GHC--module Text.XHtmlCombinators.Attributes.Internal.Safe- ( emptyAttr- , intAttr- , textAttr- ) where--import Data.Text (Text)-import qualified Data.Text as T--import Text.XHtmlCombinators.Internal-import Text.XHtmlCombinators.Escape--emptyAttr :: Text -> Attr-emptyAttr name = Attr name (escapeAttr name)--intAttr :: Text -> Int -> Attr-intAttr name = Attr name . T.pack . show--textAttr :: Text -> Text -> Attr-textAttr name = Attr name . escapeAttr
− src/Text/XHtmlCombinators/Attributes/Safe.hs
@@ -1,133 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}---- |--- Module : Text.XHtmlCombinators.Attributes--- Copyright : (c) Andy Gill, and the Oregon Graduate Institute of Science and Technology 1999-2001--- (c) Bjorn Bringert 2004-2006--- (c) Alasdair Armstrong 2010--- License : BSD-style--- Maintainer : alasdair.armstrong@googlemail.com--- Stability : experimental--- Portability : GHC--module Text.XHtmlCombinators.Attributes.Safe where--import Data.Char (isAsciiLower)--import Data.Text (Text)-import qualified Data.Text as T--import Text.XHtmlCombinators.Internal (Attr (Attr))-import Text.XHtmlCombinators.Escape-import Text.XHtmlCombinators.Attributes.Internal.Safe--attr :: Text -> Text -> Attr-attr name = Attr (T.filter isAsciiLower name) . escapeAttr---- the following was copied almost verbatim from Bjorn Bringert's xhtml library.--- See: http://hackage.haskell.org/package/xhtml---- TODO: Not all attributes are currently available.--action :: Text -> Attr-align :: Text -> Attr-alt :: Text -> Attr-altcode :: Text -> Attr-archive :: Text -> Attr-base :: Text -> Attr-border :: Int -> Attr-bordercolor :: Text -> Attr-cellpadding :: Int -> Attr-cellspacing :: Int -> Attr-checked :: Attr-codebase :: Text -> Attr-cols :: Text -> Attr-colspan :: Int -> Attr-content :: Text -> Attr-coords :: Text -> Attr-disabled :: Attr-enctype :: Text -> Attr-height :: Text -> Attr-href :: Text -> Attr-hreflang :: Text -> Attr-httpEquiv :: Text -> Attr-id_ :: Text -> Attr-ismap :: Attr-lang :: Text -> Attr-maxlength :: Int -> Attr-method :: Text -> Attr-multiple :: Attr-name :: Text -> Attr-nohref :: Attr-rel :: Text -> Attr-rev :: Text -> Attr-rows :: Text -> Attr-rowspan :: Int -> Attr-rules :: Text -> Attr-selected :: Attr-shape :: Text -> Attr-size :: Text -> Attr-src :: Text -> Attr-class_ :: Text -> Attr-for :: Text -> Attr-style :: Text -> Attr-type_ :: Text -> Attr-title :: Text -> Attr-usemap :: Text -> Attr-valign :: Text -> Attr-value :: Text -> Attr-width :: Text -> Attr--action = textAttr "action"-align = textAttr "align"-alt = textAttr "alt"-altcode = textAttr "altcode"-archive = textAttr "archive"-base = textAttr "base"-border = intAttr "border"-bordercolor = textAttr "bordercolor"-cellpadding = intAttr "cellpadding"-cellspacing = intAttr "cellspacing"-checked = emptyAttr "checked"-codebase = textAttr "codebase"-cols = textAttr "cols"-colspan = intAttr "colspan"-content = textAttr "content"-coords = textAttr "coords"-disabled = emptyAttr "disabled"-enctype = textAttr "enctype"-height = textAttr "height"-href = textAttr "href"-hreflang = textAttr "hreflang"-httpEquiv = textAttr "http-equiv"-id_ = textAttr "id"-ismap = emptyAttr "ismap"-lang = textAttr "lang"-maxlength = intAttr "maxlength"-method = textAttr "method"-multiple = emptyAttr "multiple"-name = textAttr "name"-nohref = emptyAttr "nohref"-rel = textAttr "rel"-rev = textAttr "rev"-rows = textAttr "rows"-rowspan = intAttr "rowspan"-rules = textAttr "rules"-selected = emptyAttr "selected"-shape = textAttr "shape"-size = textAttr "size"-src = textAttr "src"-class_ = textAttr "class"-for = textAttr "for"---style = textAttr "style"-type_ = textAttr "type"-title = textAttr "title"-usemap = textAttr "usemap"-valign = textAttr "valign"-value = textAttr "value"-width = textAttr "width"---- |--- Currently data input into the style tag is not--- escaped.-style = Attr "style"
− src/Text/XHtmlCombinators/Combinators.lhs
@@ -1,1632 +0,0 @@-> {-# LANGUAGE OverloadedStrings, FlexibleInstances #-}--> -- |-> -- Module : Text.XHtmlCombinators.Combinators-> -- Copyright : (c) Alasdair Armstrong 2010-> -- License : BSD-style-> -- Maintainer : alasdair.armstrong@googlemail.com-> -- Stability : experimental-> -- Portability : GHC->-> module Text.XHtmlCombinators.Combinators where->-> import Control.Applicative hiding (empty)-> import Data.Sequence (Seq)-> import qualified Data.Sequence as Seq->-> import Data.Text (Text)-> import qualified Data.Text as T->-> import Text.XHtmlCombinators.Internal--<!--- Extensible HTML version 1.0 Strict DTD-- This is the same as HTML 4 Strict except for- changes due to the differences between XML and SGML.-- Namespace = http://www.w3.org/1999/xhtml-- For further information, see: http://www.w3.org/TR/xhtml1-- Copyright (c) 1998-2002 W3C (MIT, INRIA, Keio),- All Rights Reserved. -- This DTD module is identified by the PUBLIC and SYSTEM identifiers:-- PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"- SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"-- $Revision: 1.1 $- $Date: 2002/08/01 13:56:03 $---->--> -- ================ Character mnemonic entities =========================-->--<!ENTITY % HTMLlat1 PUBLIC- "-//W3C//ENTITIES Latin 1 for XHTML//EN"- "xhtml-lat1.ent">-%HTMLlat1;--<!ENTITY % HTMLsymbol PUBLIC- "-//W3C//ENTITIES Symbols for XHTML//EN"- "xhtml-symbol.ent">-%HTMLsymbol;--<!ENTITY % HTMLspecial PUBLIC- "-//W3C//ENTITIES Special for XHTML//EN"- "xhtml-special.ent">-%HTMLspecial;--> -- ================== Imported Names ====================================-->--<!ENTITY % ContentType "CDATA">- <!-- media type, as per [RFC2045] -->--<!ENTITY % ContentTypes "CDATA">- <!-- comma-separated list of media types, as per [RFC2045] -->--<!ENTITY % Charset "CDATA">- <!-- a character encoding, as per [RFC2045] -->--<!ENTITY % Charsets "CDATA">- <!-- a space separated list of character encodings, as per [RFC2045] -->--<!ENTITY % LanguageCode "NMTOKEN">- <!-- a language code, as per [RFC3066] -->--<!ENTITY % Character "CDATA">- <!-- a single character, as per section 2.2 of [XML] -->--<!ENTITY % Number "CDATA">- <!-- one or more digits -->--<!ENTITY % LinkTypes "CDATA">- <!-- space-separated list of link types -->--<!ENTITY % MediaDesc "CDATA">- <!-- single or comma-separated list of media descriptors -->--<!ENTITY % URI "CDATA">- <!-- a Uniform Resource Identifier, see [RFC2396] -->--<!ENTITY % UriList "CDATA">- <!-- a space separated list of Uniform Resource Identifiers -->--<!ENTITY % Datetime "CDATA">- <!-- date and time information. ISO date format -->--<!ENTITY % Script "CDATA">- <!-- script expression -->--<!ENTITY % StyleSheet "CDATA">- <!-- style sheet data -->--<!ENTITY % Text "CDATA">- <!-- used for titles etc. -->--<!ENTITY % Length "CDATA">- <!-- nn for pixels or nn% for percentage length -->--<!ENTITY % MultiLength "CDATA">- <!-- pixel, percentage, or relative -->--<!ENTITY % Pixels "CDATA">- <!-- integer representing length in pixels -->--<!-- these are used for image maps -->--<!ENTITY % Shape "(rect|circle|poly|default)">--<!ENTITY % Coords "CDATA">- <!-- comma separated list of lengths -->--> -- =================== Generic Attributes ===============================-->--<!-- core attributes common to most elements- id document-wide unique id- class space separated list of classes- style associated style info- title advisory title/amplification--->-<!ENTITY % coreattrs- "id ID #IMPLIED- class CDATA #IMPLIED- style %StyleSheet; #IMPLIED- title %Text; #IMPLIED"- >--<!-- internationalization attributes- lang language code (backwards compatible)- xml:lang language code (as per XML 1.0 spec)- dir direction for weak/neutral text--->-<!ENTITY % i18n- "lang %LanguageCode; #IMPLIED- xml:lang %LanguageCode; #IMPLIED- dir (ltr|rtl) #IMPLIED"- >--<!-- attributes for common UI events- onclick a pointer button was clicked- ondblclick a pointer button was double clicked- onmousedown a pointer button was pressed down- onmouseup a pointer button was released- onmousemove a pointer was moved onto the element- onmouseout a pointer was moved away from the element- onkeypress a key was pressed and released- onkeydown a key was pressed down- onkeyup a key was released--->-<!ENTITY % events- "onclick %Script; #IMPLIED- ondblclick %Script; #IMPLIED- onmousedown %Script; #IMPLIED- onmouseup %Script; #IMPLIED- onmouseover %Script; #IMPLIED- onmousemove %Script; #IMPLIED- onmouseout %Script; #IMPLIED- onkeypress %Script; #IMPLIED- onkeydown %Script; #IMPLIED- onkeyup %Script; #IMPLIED"- >--<!-- attributes for elements that can get the focus- accesskey accessibility key character- tabindex position in tabbing order- onfocus the element got the focus- onblur the element lost the focus--->-<!ENTITY % focus- "accesskey %Character; #IMPLIED- tabindex %Number; #IMPLIED- onfocus %Script; #IMPLIED- onblur %Script; #IMPLIED"- >--<!ENTITY % attrs "%coreattrs; %i18n; %events;">--> -- =================== Text Elements ====================================-->--<!ENTITY % special.pre- "br | span | bdo | map">--<!ENTITY % special- "%special.pre; | object | img ">--<!ENTITY % fontstyle "tt | i | b | big | small ">--<!ENTITY % phrase "em | strong | dfn | code | q |- samp | kbd | var | cite | abbr | acronym | sub | sup ">--<!ENTITY % inline.forms "input | select | textarea | label | button">--<!-- these can occur at block or inline level -->-<!ENTITY % misc.inline "ins | del | script">--<!-- these can only occur at block level -->-<!ENTITY % misc "noscript | %misc.inline;">--<!ENTITY % inline "a | %special; | %fontstyle; | %phrase; | %inline.forms;">--<!-- %Inline; covers inline or "text-level" elements -->-<!ENTITY % Inline "(#PCDATA | %inline; | %misc.inline;)*">--> class CData c where-> cdata :: Text -> c->-> text :: (Functor t, Monad t, CData c) => Text -> XHtmlT t c-> text = tellS . cdata->-> newtype InlineContent = Inline { inlineToNode :: Node }->-> instance Content InlineContent where -> toContent = inlineToNode->-> instance CData InlineContent where-> cdata = Inline . TextNode-> -> class Inline c where-> inline :: Node -> c->-> instance Inline InlineContent where inline = Inline-> instance Inline FlowContent where inline = Flow--> -- ================== Block level elements ==============================-->--<!ENTITY % heading "h1|h2|h3|h4|h5|h6">-<!ENTITY % lists "ul | ol | dl">-<!ENTITY % blocktext "pre | hr | blockquote | address">--<!ENTITY % block- "p | %heading; | div | %lists; | %blocktext; | fieldset | table">--<!ENTITY % Block "(%block; | form | %misc;)*">--> newtype BlockContent = Block { blockToNode :: Node }->-> instance Content BlockContent where -> toContent = blockToNode->-> class Block c where-> block :: Node -> c->-> instance Block BlockContent where block = Block-> instance Block FlowContent where block = Flow--<!-- %Flow; mixes block and inline and is used for list items etc. -->-<!ENTITY % Flow "(#PCDATA | %block; | form | %inline; | %misc;)*">--> newtype FlowContent = Flow { flowToNode :: Node }->-> instance Content FlowContent where -> toContent = flowToNode->-> instance CData FlowContent where-> cdata = Flow . TextNode->-> class Flow c where-> flow :: Node -> c->-> instance Flow BlockContent where flow = Block-> instance Flow InlineContent where flow = Inline-> instance Flow FlowContent where flow = Flow--> -- ================== Content models for exclusions =====================-->--<!-- a elements use %Inline; excluding a -->--<!ENTITY % a.content- "(#PCDATA | %special; | %fontstyle; | %phrase; | %inline.forms; | %misc.inline;)*">--<!-- pre uses %Inline excluding big, small, sup or sup -->--<!ENTITY % pre.content- "(#PCDATA | a | %fontstyle; | %phrase; | %special.pre; | %misc.inline;- | %inline.forms;)*">--<!-- form uses %Block; excluding form -->--<!ENTITY % form.content "(%block; | %misc;)*">--<!-- button uses %Flow; but excludes a, form and form controls -->--<!ENTITY % button.content- "(#PCDATA | p | %heading; | div | %lists; | %blocktext; |- table | %special; | %fontstyle; | %phrase; | %misc;)*">--> -- ================ Document Structure ==================================-->--<!-- the namespace URI designates the document profile -->--<!ELEMENT html (head, body)>-<!ATTLIST html- %i18n;- id ID #IMPLIED- xmlns %URI; #FIXED 'http://www.w3.org/1999/xhtml'- >--> newtype Page = Page { pageToNode :: Node }->-> newtype TopLevelContent = TopLevel { topLevelToNode :: Node }->-> instance Content Page where toContent = pageToNode->-> instance Content TopLevelContent where -> toContent = topLevelToNode--> xhtml10strict :: Text-> xhtml10strict = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\-> \ \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">"->-> doctype :: (Functor t, Monad t) => XHtmlT t Page-> doctype = tellS . Page . TextNode $ xhtml10strict->-> xmlDec :: (Functor t, Monad t) => XHtmlT t Page-> xmlDec = tellS . Page . TextNode $ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"->-> html' :: (Functor t, Monad t)-> => Bool -- ^ True for XML declaration, false to omit.-> -> Attrs -> XHtmlT t TopLevelContent -> XHtmlT t Page-> html' useXmlDec attrs x = do-> if useXmlDec then xmlDec else empty-> doctype -> tellNode Page "html" [Attr "xmlns" "http://www.w3.org/1999/xhtml"] attrs x->-> html :: (Functor t, Monad t) => Bool -> XHtmlT t TopLevelContent -> XHtmlT t Page-> html useXmlDec = html' useXmlDec []--> -- ================ Document Head =======================================-->--<!ENTITY % head.misc "(script|style|meta|link|object)*">--> newtype HeadContent = Head { headToNode :: Node }->-> instance Content HeadContent where -> toContent = headToNode--<!-- content model is %head.misc; combined with a single- title and an optional base element in any order -->--<!ELEMENT head (%head.misc;,- ((title, %head.misc;, (base, %head.misc;)?) |- (base, %head.misc;, (title, %head.misc;))))>--<!ATTLIST head- %i18n;- id ID #IMPLIED- profile %URI; #IMPLIED- >--> head' :: (Functor t, Monad t) => Attrs -> XHtmlT t HeadContent -> XHtmlT t TopLevelContent-> head' = tellNode TopLevel "head" []->-> head_ :: (Functor t, Monad t) => XHtmlT t HeadContent -> XHtmlT t TopLevelContent-> head_ = head' []--<!-- The title element is not considered part of the flow of text.- It should be displayed, for example as the page header or- window title. Exactly one title is required per document.- -->-<!ELEMENT title (#PCDATA)>-<!ATTLIST title - %i18n;- id ID #IMPLIED- >--> title' :: (Functor t, Monad t) => Attrs -> Text -> XHtmlT t HeadContent-> title' = tellTextNode Head "title" []->-> title :: (Functor t, Monad t) => Text -> XHtmlT t HeadContent-> title = title' []--<!-- document base URI -->--<!ELEMENT base EMPTY>-<!ATTLIST base- href %URI; #REQUIRED- id ID #IMPLIED- >--> base' :: (Functor t, Monad t) => Text -> Attrs -> XHtmlT t HeadContent-> base' href = tellEmptyNode Head "base" [Attr "href" href]->-> base :: (Functor t, Monad t) => Text -> XHtmlT t HeadContent-> base = flip base' []--<!-- generic metainformation -->-<!ELEMENT meta EMPTY>-<!ATTLIST meta- %i18n;- id ID #IMPLIED- http-equiv CDATA #IMPLIED- name CDATA #IMPLIED- content CDATA #REQUIRED- scheme CDATA #IMPLIED- >--> meta' :: (Functor t, Monad t) => Text -- ^ Required content attribute.-> -> Attrs -> XHtmlT t HeadContent-> meta' content = tellEmptyNode Head "meta" [Attr "content" content]->-> meta :: (Functor t, Monad t) => Text -> XHtmlT t HeadContent-> meta = flip meta' []--<!--- Relationship values can be used in principle:-- a) for document specific toolbars/menus when used- with the link element in document head e.g.- start, contents, previous, next, index, end, help- b) to link to a separate style sheet (rel="stylesheet")- c) to make a link to a script (rel="script")- d) by stylesheets to control how collections of- html nodes are rendered into printed documents- e) to make a link to a printable version of this document- e.g. a PostScript or PDF version (rel="alternate" media="print")--->--<!ELEMENT link EMPTY>-<!ATTLIST link- %attrs;- charset %Charset; #IMPLIED- href %URI; #IMPLIED- hreflang %LanguageCode; #IMPLIED- type %ContentType; #IMPLIED- rel %LinkTypes; #IMPLIED- rev %LinkTypes; #IMPLIED- media %MediaDesc; #IMPLIED- >--> link' :: (Functor t, Monad t) => Attrs -> XHtmlT t HeadContent-> link' = tellEmptyNode Head "link" []->-> link :: (Functor t, Monad t) => XHtmlT t HeadContent-> link = link' []-> -- ^ 'link' is a bit useless without any attributes, but it's -> -- included anyway for consistency reasons. As are several-> -- other similar elements.--<!-- style info, which may include CDATA sections -->-<!ELEMENT style (#PCDATA)>-<!ATTLIST style- %i18n;- id ID #IMPLIED- type %ContentType; #REQUIRED- media %MediaDesc; #IMPLIED- title %Text; #IMPLIED- xml:space (preserve) #FIXED 'preserve'- >--> style' :: (Functor t, Monad t) => Text -- ^ Required type attribute.-> -> Attrs -> Text -> XHtmlT t HeadContent-> style' type_ = tellTextNode Head "style" [Attr "type" type_]->-> style :: (Functor t, Monad t) => Text -> Text -> XHtmlT t HeadContent-> style = flip style' []--<!-- script statements, which may include CDATA sections -->-<!ELEMENT script (#PCDATA)>-<!ATTLIST script- id ID #IMPLIED- charset %Charset; #IMPLIED- type %ContentType; #REQUIRED- src %URI; #IMPLIED- defer (defer) #IMPLIED- xml:space (preserve) #FIXED 'preserve'- >--> script' :: (Functor t, Monad t) -> => Text -- ^ Required type attribute.-> -> Attrs -> Text -> XHtmlT t HeadContent-> script' type_ = tellTextNode Head "script" [Attr "type" type_]->-> script :: (Functor t, Monad t) => Text -> Text -> XHtmlT t HeadContent-> script = flip script' []--<!-- alternate content container for non script-based rendering -->--<!ELEMENT noscript %Block;>-<!ATTLIST noscript- %attrs;- >--> noscript' :: (Functor t, Monad t, Block c) => Attrs -> XHtmlT t BlockContent -> XHtmlT t c-> noscript' = tellNode block "noscript" []->-> noscript :: (Functor t, Monad t, Block c) => XHtmlT t BlockContent -> XHtmlT t c-> noscript = noscript' []--> -- =================== Document Body ====================================-->--<!ELEMENT body %Block;>-<!ATTLIST body- %attrs;- onload %Script; #IMPLIED- onunload %Script; #IMPLIED- >--> body' :: (Functor t, Monad t) => Attrs -> XHtmlT t BlockContent -> XHtmlT t TopLevelContent-> body' = tellNode TopLevel "body" []->-> body :: (Functor t, Monad t) => XHtmlT t BlockContent -> XHtmlT t TopLevelContent-> body = body' [] --<!ELEMENT div %Flow;> <!-- generic language/style container -->-<!ATTLIST div- %attrs;- >--> div' :: (Functor t, Monad t, Block c) => Attrs -> XHtmlT t FlowContent -> XHtmlT t c-> div' = tellNode block "div" []-> -> div_ :: (Functor t, Monad t, Block c) => XHtmlT t FlowContent -> XHtmlT t c-> div_ = div' []--> -- =================== Paragraphs =======================================-->--<!ELEMENT p %Inline;>-<!ATTLIST p- %attrs;- >--> p' :: (Functor t, Monad t, Block c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c-> p' = tellNode block "p" []->-> p :: (Functor t, Monad t, Block c) => XHtmlT t InlineContent -> XHtmlT t c-> p = p' []--> -- =================== Headings =========================================-->--<!--- There are six levels of headings from h1 (the most important)- to h6 (the least important).--->--<!ELEMENT h1 %Inline;>-<!ATTLIST h1- %attrs;- >--> h1' :: (Functor t, Monad t, Block c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c-> h1' = tellNode block "h1" []->-> h1 :: (Functor t, Monad t, Block c) => XHtmlT t InlineContent -> XHtmlT t c-> h1 = h1' []--<!ELEMENT h2 %Inline;>-<!ATTLIST h2- %attrs;- >--> h2' :: (Functor t, Monad t, Block c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c-> h2' = tellNode block "h2" []->-> h2 :: (Functor t, Monad t, Block c) => XHtmlT t InlineContent -> XHtmlT t c-> h2 = h2' []--<!ELEMENT h3 %Inline;>-<!ATTLIST h3- %attrs;- >--> h3' :: (Functor t, Monad t, Block c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c-> h3' = tellNode block "h3" []->-> h3 :: (Functor t, Monad t, Block c) => XHtmlT t InlineContent -> XHtmlT t c-> h3 = h3' []--<!ELEMENT h4 %Inline;>-<!ATTLIST h4- %attrs;- >--> h4' :: (Functor t, Monad t, Block c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c-> h4' = tellNode block "h4" []->-> h4 :: (Functor t, Monad t, Block c) => XHtmlT t InlineContent -> XHtmlT t c-> h4 = h4' []--<!ELEMENT h5 %Inline;>-<!ATTLIST h5- %attrs;- >--> h5' :: (Functor t, Monad t, Block c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c-> h5' = tellNode block "h5" []->-> h5 :: (Functor t, Monad t, Block c) => XHtmlT t InlineContent -> XHtmlT t c-> h5 = h5' []--<!ELEMENT h6 %Inline;>-<!ATTLIST h6- %attrs;- >--> h6' :: (Functor t, Monad t, Block c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c-> h6' = tellNode block "h6" []->-> h6 :: (Functor t, Monad t, Block c) => XHtmlT t InlineContent -> XHtmlT t c-> h6 = h6' []--> -- =================== Lists ============================================-->--<!-- Unordered list -->--> newtype ListContent = List { listToNode :: Node }->-> instance Content ListContent where-> toContent = listToNode--<!ELEMENT ul (li)+>-<!ATTLIST ul- %attrs;- >--> ul' :: (Functor t, Monad t, Block c) => Attrs -> XHtmlT t ListContent -> XHtmlT t c-> ul' = tellNode block "ul" []->-> ul :: (Functor t, Monad t, Block c) => XHtmlT t ListContent -> XHtmlT t c-> ul = ul' []--<!-- Ordered (numbered) list -->--<!ELEMENT ol (li)+>-<!ATTLIST ol- %attrs;- >--> ol' :: (Functor t, Monad t, Block c) => Attrs -> XHtmlT t ListContent -> XHtmlT t c-> ol' = tellNode block "ol" []->-> ol :: (Functor t, Monad t, Block c) => XHtmlT t ListContent -> XHtmlT t c-> ol = ol' []--<!-- list item -->--<!ELEMENT li %Flow;>-<!ATTLIST li- %attrs;- >--> li' :: (Functor t, Monad t) => Attrs -> XHtmlT t FlowContent -> XHtmlT t ListContent-> li' = tellNode List "li" []->-> li :: (Functor t, Monad t) => XHtmlT t FlowContent -> XHtmlT t ListContent-> li = li' []--<!-- definition lists - dt for term, dd for its definition -->--> newtype DefinitionListContent = -> DefinitionList { definitionListToNode :: Node }->-> instance Content DefinitionListContent where-> toContent = definitionListToNode--<!ELEMENT dl (dt|dd)+>-<!ATTLIST dl- %attrs;- >--> dl' :: (Functor t, Monad t, Block c) => Attrs -> XHtmlT t DefinitionListContent -> XHtmlT t c-> dl' = tellNode block "dl" []->-> dl :: (Functor t, Monad t, Block c) => XHtmlT t DefinitionListContent -> XHtmlT t c-> dl = dl' []--<!ELEMENT dt %Inline;>-<!ATTLIST dt- %attrs;- >--> dt' :: (Functor t, Monad t) => Attrs -> XHtmlT t InlineContent -> XHtmlT t DefinitionListContent-> dt' = tellNode DefinitionList "dt" []->-> dt :: (Functor t, Monad t) => XHtmlT t InlineContent -> XHtmlT t DefinitionListContent-> dt = dt' []--<!ELEMENT dd %Flow;>-<!ATTLIST dd- %attrs;- >--> dd' :: (Functor t, Monad t) => Attrs -> XHtmlT t InlineContent -> XHtmlT t DefinitionListContent-> dd' = tellNode DefinitionList "dd" []->-> dd :: (Functor t, Monad t) => XHtmlT t InlineContent -> XHtmlT t DefinitionListContent-> dd = dd' []--> -- =================== Address ==========================================-->--<!-- information on author -->--<!ELEMENT address %Inline;>-<!ATTLIST address- %attrs;- >--> address' :: (Functor t, Monad t, Block c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c-> address' = tellNode block "address" []->-> address :: (Functor t, Monad t, Block c) => XHtmlT t InlineContent -> XHtmlT t c-> address = address' []--> -- =================== Horizontal Rule ==================================-->--<!ELEMENT hr EMPTY>-<!ATTLIST hr- %attrs;- >--> hr' :: (Functor t, Monad t, Block c) => Attrs -> XHtmlT t c-> hr' = tellEmptyNode block "hr" []->-> hr :: (Functor t, Monad t, Block c) => XHtmlT t c-> hr = hr' []--> -- =================== Preformatted Text ================================-->--<!-- content is %Inline; excluding "img|object|big|small|sub|sup" -->--<!ELEMENT pre %pre.content;>-<!ATTLIST pre- %attrs;- xml:space (preserve) #FIXED 'preserve'- >--> pre' :: (Functor t, Monad t, Block c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c-> pre' = tellNode block "pre" []->-> pre :: (Functor t, Monad t, Block c) => XHtmlT t InlineContent -> XHtmlT t c-> pre = pre' []--> -- =================== Block-like Quotes ================================-->--<!ELEMENT blockquote %Block;>-<!ATTLIST blockquote- %attrs;- cite %URI; #IMPLIED- >--> blockquote' :: (Functor t, Monad t, Block c) => Attrs -> XHtmlT t BlockContent -> XHtmlT t c-> blockquote' = tellNode block "blockquote" []->-> blockquote :: (Functor t, Monad t, Block c) => XHtmlT t BlockContent -> XHtmlT t c-> blockquote = blockquote' []--> -- =================== Inserted/Deleted Text ============================-->--<!--- ins/del are allowed in block and inline content, but its- inappropriate to include block content within an ins element- occurring in inline content.--->-<!ELEMENT ins %Flow;>-<!ATTLIST ins- %attrs;- cite %URI; #IMPLIED- datetime %Datetime; #IMPLIED- >--> ins' :: (Functor t, Monad t) => (Flow c, Content c) => Attrs -> XHtmlT t c -> XHtmlT t c-> ins' = tellNode flow "ins" []->-> ins :: (Functor t, Monad t) => (Flow c, Content c) => XHtmlT t c -> XHtmlT t c-> ins = ins' []--<!ELEMENT del %Flow;>-<!ATTLIST del- %attrs;- cite %URI; #IMPLIED- datetime %Datetime; #IMPLIED- >--> del' :: (Functor t, Monad t) => (Flow c, Content c) => Attrs -> XHtmlT t c -> XHtmlT t c-> del' = tellNode flow "del" []->-> del :: (Functor t, Monad t) => (Flow c, Content c) => XHtmlT t c -> XHtmlT t c-> del = del' []--> -- ================== The Anchor Element ================================-->--<!-- content is %Inline; except that anchors shouldn't be nested -->--<!ELEMENT a %a.content;>-<!ATTLIST a- %attrs;- %focus;- charset %Charset; #IMPLIED- type %ContentType; #IMPLIED- name NMTOKEN #IMPLIED- href %URI; #IMPLIED- hreflang %LanguageCode; #IMPLIED- rel %LinkTypes; #IMPLIED- rev %LinkTypes; #IMPLIED- shape %Shape; "rect"- coords %Coords; #IMPLIED- >--> a' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c-> a' = tellNode inline "a" []->-> a :: (Functor t, Monad t, Inline c) => XHtmlT t InlineContent -> XHtmlT t c-> a = a' []--> -- ===================== Inline Elements ================================-->--<!ELEMENT span %Inline;> <!-- generic language/style container -->-<!ATTLIST span- %attrs;- >--> span' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c-> span' = tellNode inline "span" []->-> span_ :: (Functor t, Monad t, Inline c) => XHtmlT t InlineContent -> XHtmlT t c-> span_ = span' []--<!ELEMENT bdo %Inline;> <!-- I18N BiDi over-ride -->-<!ATTLIST bdo- %coreattrs;- %events;- lang %LanguageCode; #IMPLIED- xml:lang %LanguageCode; #IMPLIED- dir (ltr|rtl) #REQUIRED- >--> bdo' :: (Functor t, Monad t, Inline c) -> => Text -- ^ Required language direction code.-> -> Attrs -> XHtmlT t InlineContent -> XHtmlT t c-> bdo' dir = tellNode inline "bdo" [Attr "dir" dir]->-> bdo :: (Functor t, Monad t, Inline c) => Text -> XHtmlT t InlineContent -> XHtmlT t c-> bdo = flip bdo' []--<!ELEMENT br EMPTY> <!-- forced line break -->-<!ATTLIST br- %coreattrs;- >--> br' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t c-> br' = tellEmptyNode inline "br" []->-> br :: (Functor t, Monad t, Inline c) => XHtmlT t c-> br = br' []--<!ELEMENT em %Inline;> <!-- emphasis -->-<!ATTLIST em %attrs;>--> em' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c-> em' = tellNode inline "em" []->-> em :: (Functor t, Monad t, Inline c) => XHtmlT t InlineContent -> XHtmlT t c-> em = em' []--<!ELEMENT strong %Inline;> <!-- strong emphasis -->-<!ATTLIST strong %attrs;>--> strong' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c-> strong' = tellNode inline "strong" []->-> strong :: (Functor t, Monad t, Inline c) => XHtmlT t InlineContent -> XHtmlT t c-> strong = strong' []--<!ELEMENT dfn %Inline;> <!-- definitional -->-<!ATTLIST dfn %attrs;>--> dfn' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c-> dfn' = tellNode inline "dfn" []->-> dfn :: (Functor t, Monad t, Inline c) => XHtmlT t InlineContent -> XHtmlT t c-> dfn = dfn' []--<!ELEMENT code %Inline;> <!-- program code -->-<!ATTLIST code %attrs;>--> code' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c-> code' = tellNode inline "code" []->-> code :: (Functor t, Monad t, Inline c) => XHtmlT t InlineContent -> XHtmlT t c-> code = code' []--<!ELEMENT samp %Inline;> <!-- sample -->-<!ATTLIST samp %attrs;>--> samp' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c-> samp' = tellNode inline "samp" []->-> samp :: (Functor t, Monad t, Inline c) => XHtmlT t InlineContent -> XHtmlT t c-> samp = samp' []--<!ELEMENT kbd %Inline;> <!-- something user would type -->-<!ATTLIST kbd %attrs;>--> kbd' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c-> kbd' = tellNode inline "kbd" []->-> kbd :: (Functor t, Monad t, Inline c) => XHtmlT t InlineContent -> XHtmlT t c-> kbd = kbd' []--<!ELEMENT var %Inline;> <!-- variable -->-<!ATTLIST var %attrs;>--> var' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c-> var' = tellNode inline "var" []->-> var :: (Functor t, Monad t, Inline c) => XHtmlT t InlineContent -> XHtmlT t c-> var = var' []--<!ELEMENT cite %Inline;> <!-- citation -->-<!ATTLIST cite %attrs;>--> cite' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c-> cite' = tellNode inline "cite" []->-> cite :: (Functor t, Monad t, Inline c) => XHtmlT t InlineContent -> XHtmlT t c-> cite = cite' []--<!ELEMENT abbr %Inline;> <!-- abbreviation -->-<!ATTLIST abbr %attrs;>--> abbr' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c-> abbr' = tellNode inline "abbr" []->-> abbr :: (Functor t, Monad t, Inline c) => XHtmlT t InlineContent -> XHtmlT t c-> abbr = abbr' []--<!ELEMENT acronym %Inline;> <!-- acronym -->-<!ATTLIST acronym %attrs;>--> acronym' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c-> acronym' = tellNode inline "acronym" []->-> acronym :: (Functor t, Monad t, Inline c) => XHtmlT t InlineContent -> XHtmlT t c-> acronym = acronym' []--<!ELEMENT q %Inline;> <!-- inlined quote -->-<!ATTLIST q- %attrs;- cite %URI; #IMPLIED- >--> q' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c-> q' = tellNode inline "q" []->-> q :: (Functor t, Monad t, Inline c) => XHtmlT t InlineContent -> XHtmlT t c-> q = q' []--<!ELEMENT sub %Inline;> <!-- subscript -->-<!ATTLIST sub %attrs;>--> sub' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c-> sub' = tellNode inline "sub" []->-> sub :: (Functor t, Monad t, Inline c) => XHtmlT t InlineContent -> XHtmlT t c-> sub = sub' []--<!ELEMENT sup %Inline;> <!-- superscript -->-<!ATTLIST sup %attrs;>--> sup' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c-> sup' = tellNode inline "sup" []->-> sup :: (Functor t, Monad t, Inline c) => XHtmlT t InlineContent -> XHtmlT t c-> sup = sup' []--<!ELEMENT tt %Inline;> <!-- fixed pitch font -->-<!ATTLIST tt %attrs;>--> tt' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c-> tt' = tellNode inline "tt" []->-> tt :: (Functor t, Monad t, Inline c) => XHtmlT t InlineContent -> XHtmlT t c-> tt = tt' []--<!ELEMENT i %Inline;> <!-- italic font -->-<!ATTLIST i %attrs;>--> i' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c-> i' = tellNode inline "i" []->-> i :: (Functor t, Monad t, Inline c) => XHtmlT t InlineContent -> XHtmlT t c-> i = i' []--<!ELEMENT b %Inline;> <!-- bold font -->-<!ATTLIST b %attrs;>--> b' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c-> b' = tellNode inline "b" []->-> b :: (Functor t, Monad t, Inline c) => XHtmlT t InlineContent -> XHtmlT t c-> b = b' []--<!ELEMENT big %Inline;> <!-- bigger font -->-<!ATTLIST big %attrs;>--> big' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c-> big' = tellNode inline "big" []->-> big :: (Functor t, Monad t, Inline c) => XHtmlT t InlineContent -> XHtmlT t c-> big = big' []--<!ELEMENT small %Inline;> <!-- smaller font -->-<!ATTLIST small %attrs;>--> small' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c-> small' = tellNode inline "small" []->-> small :: (Functor t, Monad t, Inline c) => XHtmlT t InlineContent -> XHtmlT t c-> small = small' []--> -- ==================== Object ======================================-->--> newtype ObjectContent = Object { objectToNode :: Node }->-> instance Content ObjectContent where -> toContent = objectToNode->-> instance Flow ObjectContent where flow = Object-> instance Inline ObjectContent where inline = Object-> instance Block ObjectContent where block = Object--<!--- object is used to embed objects as part of HTML pages.- param elements should precede other content. Parameters- can also be expressed as attribute/value pairs on the- object element itself when brevity is desired.--->--<!ELEMENT object (#PCDATA | param | %block; | form | %inline; | %misc;)*>-<!ATTLIST object- %attrs;- declare (declare) #IMPLIED- classid %URI; #IMPLIED- codebase %URI; #IMPLIED- data %URI; #IMPLIED- type %ContentType; #IMPLIED- codetype %ContentType; #IMPLIED- archive %UriList; #IMPLIED- standby %Text; #IMPLIED- height %Length; #IMPLIED- width %Length; #IMPLIED- usemap %URI; #IMPLIED- name NMTOKEN #IMPLIED- tabindex %Number; #IMPLIED- >--> object' :: (Functor t, Monad t, Flow c) => Attrs -> XHtmlT t ObjectContent -> XHtmlT t c-> object' = tellNode flow "object" []->-> object :: (Functor t, Monad t, Flow c) => XHtmlT t ObjectContent -> XHtmlT t c-> object = object' []--<!--- param is used to supply a named property value.- In XML it would seem natural to follow RDF and support an- abbreviated syntax where the param elements are replaced- by attribute value pairs on the object start tag.--->-<!ELEMENT param EMPTY>-<!ATTLIST param- id ID #IMPLIED- name CDATA #IMPLIED- value CDATA #IMPLIED- valuetype (data|ref|object) "data"- type %ContentType; #IMPLIED- >--> param' :: (Functor t, Monad t) => Attrs -> XHtmlT t ObjectContent-> param' = tellEmptyNode Object "param" []->-> param :: (Functor t, Monad t) => XHtmlT t ObjectContent-> param = param' []--> -- =================== Images ===========================================-->--<!--- To avoid accessibility problems for people who aren't- able to see the image, you should provide a text- description using the alt and longdesc attributes.- In addition, avoid the use of server-side image maps.- Note that in this DTD there is no name attribute. That- is only available in the transitional and frameset DTD.--->--<!ELEMENT img EMPTY>-<!ATTLIST img- %attrs;- src %URI; #REQUIRED- alt %Text; #REQUIRED- longdesc %URI; #IMPLIED- height %Length; #IMPLIED- width %Length; #IMPLIED- usemap %URI; #IMPLIED- ismap (ismap) #IMPLIED- >--> img' :: (Functor t, Monad t, Flow c) -> => Text -- ^ Required src attribute. -> -> Text -- ^ Required alt attribute.-> -> Attrs -> XHtmlT t c-> img' src alt = tellEmptyNode flow "img" []->-> img :: (Functor t, Monad t, Flow c) => Text -> Text -> XHtmlT t c-> img src alt = img' src alt [Attr "src" src, Attr "alt" alt]--<!-- usemap points to a map element which may be in this document- or an external document, although the latter is not widely supported -->--> -- ================== Client-side image maps ============================-->--> newtype MapContent = Map { mapToNode :: Node }->-> instance Content MapContent where -> toContent = mapToNode->-> instance Flow MapContent where flow = Map-> instance Inline MapContent where inline = Map-> instance Block MapContent where block = Map--<!-- These can be placed in the same document or grouped in a- separate document although this isn't yet widely supported -->--<!ELEMENT map ((%block; | form | %misc;)+ | area+)>-<!ATTLIST map- %i18n;- %events;- id ID #REQUIRED- class CDATA #IMPLIED- style %StyleSheet; #IMPLIED- title %Text; #IMPLIED- name NMTOKEN #IMPLIED- >--> map' :: (Functor t, Monad t, Flow c) -> => Text -- ^ Required id attribute. -> -> Attrs -> XHtmlT t MapContent -> XHtmlT t c-> map' id = tellNode flow "map" [Attr "id" id]->-> map_ :: (Functor t, Monad t, Flow c) => Text -> XHtmlT t MapContent -> XHtmlT t c-> map_ = flip map' []--<!ELEMENT area EMPTY>-<!ATTLIST area- %attrs;- %focus;- shape %Shape; "rect"- coords %Coords; #IMPLIED- href %URI; #IMPLIED- nohref (nohref) #IMPLIED- alt %Text; #REQUIRED- >--> area' :: (Functor t, Monad t) => Text -- ^ Required alt attribute.-> -> Attrs -> XHtmlT t MapContent-> area' alt = tellEmptyNode Map "area" [Attr "alt" alt]->-> area :: (Functor t, Monad t) => Text -> XHtmlT t MapContent-> area = flip area' []--> -- ================ Forms ===============================================-->--<!ELEMENT form %form.content;> <!-- forms shouldn't be nested -->--<!ATTLIST form- %attrs;- action %URI; #REQUIRED- method (get|post) "get"- enctype %ContentType; "application/x-www-form-urlencoded"- onsubmit %Script; #IMPLIED- onreset %Script; #IMPLIED- accept %ContentTypes; #IMPLIED- accept-charset %Charsets; #IMPLIED- >--> form' :: (Functor t, Monad t, Block c)-> => Text -- ^ Required action attribute. -> -> Attrs -> XHtmlT t FlowContent -> XHtmlT t c-> form' action = tellNode block "form" [Attr "action" action]->-> form :: (Functor t, Monad t, Block c) => Text -> XHtmlT t FlowContent -> XHtmlT t c-> form = flip form' []--<!--- Each label must not contain more than ONE field- Label elements shouldn't be nested.--->-<!ELEMENT label %Inline;>-<!ATTLIST label- %attrs;- for IDREF #IMPLIED- accesskey %Character; #IMPLIED- onfocus %Script; #IMPLIED- onblur %Script; #IMPLIED- >--> label' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c-> label' = tellNode inline "label" []->-> label :: (Functor t, Monad t, Inline c) => XHtmlT t InlineContent -> XHtmlT t c-> label = label' []--<!ENTITY % InputType- "(text | password | checkbox |- radio | submit | reset |- file | hidden | image | button)"- >--<!-- the name attribute is required for all but submit & reset -->--<!ELEMENT input EMPTY> <!-- form control -->-<!ATTLIST input- %attrs;- %focus;- type %InputType; "text"- name CDATA #IMPLIED- value CDATA #IMPLIED- checked (checked) #IMPLIED- disabled (disabled) #IMPLIED- readonly (readonly) #IMPLIED- size CDATA #IMPLIED- maxlength %Number; #IMPLIED- src %URI; #IMPLIED- alt CDATA #IMPLIED- usemap %URI; #IMPLIED- onselect %Script; #IMPLIED- onchange %Script; #IMPLIED- accept %ContentTypes; #IMPLIED- >--> input' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t c-> input' = tellEmptyNode inline "input" []->-> input :: (Functor t, Monad t, Inline c) => XHtmlT t c-> input = input' []--<!ELEMENT select (optgroup|option)+> <!-- option selector -->-<!ATTLIST select- %attrs;- name CDATA #IMPLIED- size %Number; #IMPLIED- multiple (multiple) #IMPLIED- disabled (disabled) #IMPLIED- tabindex %Number; #IMPLIED- onfocus %Script; #IMPLIED- onblur %Script; #IMPLIED- onchange %Script; #IMPLIED- >--> newtype OptionContent = Option { optionToNode :: Node }->-> instance Content OptionContent where -> toContent = optionToNode->-> select' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t OptionContent -> XHtmlT t c -> select' = tellNode inline "select" []->-> select :: (Functor t, Monad t, Inline c) => XHtmlT t OptionContent -> XHtmlT t c-> select = select' []--<!ELEMENT optgroup (option)+> <!-- option group -->-<!ATTLIST optgroup- %attrs;- disabled (disabled) #IMPLIED- label %Text; #REQUIRED- >--> optgroup' :: (Functor t, Monad t) => Text -- ^ Required label attribute. -> -> Attrs -> XHtmlT t OptionContent -> XHtmlT t OptionContent-> optgroup' label = tellNode Option "optgroup" [Attr "label" label]->-> optgroup :: (Functor t, Monad t) => Text -> XHtmlT t OptionContent -> XHtmlT t OptionContent-> optgroup = flip optgroup' []--<!ELEMENT option (#PCDATA)> <!-- selectable choice -->-<!ATTLIST option- %attrs;- selected (selected) #IMPLIED- disabled (disabled) #IMPLIED- label %Text; #IMPLIED- value CDATA #IMPLIED- >--> option' :: (Functor t, Monad t) => Attrs -> Text -> XHtmlT t OptionContent-> option' = tellTextNode Option "option" []->-> option :: (Functor t, Monad t) => Text -> XHtmlT t OptionContent-> option = option' []--<!ELEMENT textarea (#PCDATA)> <!-- multi-line text field -->-<!ATTLIST textarea- %attrs;- %focus;- name CDATA #IMPLIED- rows %Number; #REQUIRED- cols %Number; #REQUIRED- disabled (disabled) #IMPLIED- readonly (readonly) #IMPLIED- onselect %Script; #IMPLIED- onchange %Script; #IMPLIED- >--> textarea' :: (Functor t, Monad t, Inline c)-> => Int -- ^ Required rows attribute.-> -> Int -- ^ Required cols attribute.-> -> Attrs -> Text -> XHtmlT t c-> textarea' rows cols = tellTextNode inline "textarea" -> [ Attr "rows" (T.pack (show rows))-> , Attr "cols" (T.pack (show cols))-> ]-> -> textarea :: (Functor t, Monad t, Inline c) => Int -> Int -> Text -> XHtmlT t c-> textarea rows cols = textarea' rows cols []--<!--- The fieldset element is used to group form fields.- Only one legend element should occur in the content- and if present should only be preceded by whitespace.--->-<!ELEMENT fieldset (#PCDATA | legend | %block; | form | %inline; | %misc;)*>-<!ATTLIST fieldset- %attrs;- >--> newtype FieldSetContent = FieldSet { fieldSetToNode :: Node }->-> instance Content FieldSetContent where -> toContent = fieldSetToNode->-> instance Flow FieldSetContent where flow = FieldSet-> instance Inline FieldSetContent where inline = FieldSet-> instance Block FieldSetContent where block = FieldSet--> fieldset' :: (Functor t, Monad t, Block c) => Attrs -> XHtmlT t FieldSetContent -> XHtmlT t c-> fieldset' = tellNode block "fieldset" []->-> fieldset :: (Functor t, Monad t, Block c) => XHtmlT t FieldSetContent -> XHtmlT t c-> fieldset = fieldset' []--<!ELEMENT legend %Inline;> <!-- fieldset label -->-<!ATTLIST legend- %attrs;- accesskey %Character; #IMPLIED- >--> legend' :: (Functor t, Monad t) => Attrs -> XHtmlT t InlineContent -> XHtmlT t FieldSetContent -> legend' = tellNode FieldSet "legend" []->-> legend :: (Functor t, Monad t) => XHtmlT t InlineContent -> XHtmlT t FieldSetContent-> legend = legend' []--<!--- Content is %Flow; excluding a, form and form controls---> -<!ELEMENT button %button.content;> <!-- push button -->-<!ATTLIST button- %attrs;- %focus;- name CDATA #IMPLIED- value CDATA #IMPLIED- type (button|submit|reset) "submit"- disabled (disabled) #IMPLIED- >--> button' :: (Functor t, Monad t, Inline c) => Attrs -> XHtmlT t FlowContent -> XHtmlT t c-> button' = tellNode inline "button" []->-> button :: (Functor t, Monad t, Inline c) => XHtmlT t FlowContent -> XHtmlT t c-> button = button' []--> -- ======================= Tables =======================================-->--<!-- Derived from IETF HTML table standard, see [RFC1942] -->--<!--- The border attribute sets the thickness of the frame around the- table. The default units are screen pixels.-- The frame attribute specifies which parts of the frame around- the table should be rendered. The values are not the same as- CALS to avoid a name clash with the valign attribute.--->-<!ENTITY % TFrame "(void|above|below|hsides|lhs|rhs|vsides|box|border)">--<!--- The rules attribute defines which rules to draw between cells:-- If rules is absent then assume:- "none" if border is absent or border="0" otherwise "all"--->--<!ENTITY % TRules "(none | groups | rows | cols | all)">- -<!-- horizontal alignment attributes for cell contents-- char alignment char, e.g. char=':'- charoff offset for alignment char--->-<!ENTITY % cellhalign- "align (left|center|right|justify|char) #IMPLIED- char %Character; #IMPLIED- charoff %Length; #IMPLIED"- >--<!-- vertical alignment attributes for cell contents -->-<!ENTITY % cellvalign- "valign (top|middle|bottom|baseline) #IMPLIED"- >--> newtype Table1Content = Table1 { table1ToNode :: Node }->-> instance Content Table1Content where -> toContent = table1ToNode--> newtype Table2Content = Table2 { table2ToNode :: Node }->-> instance Content Table2Content where -> toContent = table2ToNode->-> newtype Table3Content = Table3 { table3ToNode :: Node }->-> instance Content Table3Content where -> toContent = table3ToNode->-> newtype TableColContent = TableCol { tableColToNode :: Node }->-> instance Content TableColContent where -> toContent = tableColToNode--<!ELEMENT table- (caption?, (col*|colgroup*), thead?, tfoot?, (tbody+|tr+))>--> table' :: (Functor t, Monad t, Block c) => Attrs -> XHtmlT t Table1Content -> XHtmlT t c-> table' = tellNode block "table" []-> -> table :: (Functor t, Monad t, Block c) => XHtmlT t Table1Content -> XHtmlT t c-> table = table' []--<!ELEMENT caption %Inline;>--> caption' :: (Functor t, Monad t) => Attrs -> XHtmlT t InlineContent -> XHtmlT t Table1Content-> caption' = tellNode Table1 "caption" []->-> caption :: (Functor t, Monad t) => XHtmlT t InlineContent -> XHtmlT t Table1Content-> caption = caption' []--<!ELEMENT thead (tr)+>--> thead' :: (Functor t, Monad t) => Attrs -> XHtmlT t Table2Content -> XHtmlT t Table1Content-> thead' = tellNode Table1 "thead" []->-> thead :: (Functor t, Monad t) => XHtmlT t Table2Content -> XHtmlT t Table1Content-> thead = thead' []--<!ELEMENT tfoot (tr)+>--> tfoot' :: (Functor t, Monad t) => Attrs -> XHtmlT t Table2Content -> XHtmlT t Table1Content-> tfoot' = tellNode Table1 "tfoot" []->-> tfoot :: (Functor t, Monad t) => XHtmlT t Table2Content -> XHtmlT t Table1Content-> tfoot = tfoot' []--<!ELEMENT tbody (tr)+>--> tbody' :: (Functor t, Monad t) => Attrs -> XHtmlT t Table2Content -> XHtmlT t Table1Content-> tbody' = tellNode Table1 "tbody" []->-> tbody :: (Functor t, Monad t) => XHtmlT t Table2Content -> XHtmlT t Table1Content-> tbody = tbody' []--<!ELEMENT colgroup (col)*>--> colgroup' :: (Functor t, Monad t) => Attrs -> XHtmlT t TableColContent -> XHtmlT t Table1Content-> colgroup' = tellNode Table1 "colgroup" []->-> colgroup :: (Functor t, Monad t) => XHtmlT t TableColContent -> XHtmlT t Table1Content-> colgroup = colgroup' []--<!ELEMENT col EMPTY>--> col' :: (Functor t, Monad t) => Attrs -> XHtmlT t TableColContent-> col' = tellEmptyNode TableCol "col" []->-> col :: (Functor t, Monad t) => XHtmlT t TableColContent-> col = col' []--<!ELEMENT tr (th|td)+>--> tr' :: (Functor t, Monad t) => Attrs -> XHtmlT t Table3Content -> XHtmlT t Table2Content-> tr' = tellNode Table2 "tr" []-> -> tr :: (Functor t, Monad t) => XHtmlT t Table3Content -> XHtmlT t Table2Content-> tr = tr' []--<!ELEMENT th %Flow;>--> th' :: (Functor t, Monad t) => Attrs -> XHtmlT t FlowContent -> XHtmlT t Table3Content-> th' = tellNode Table3 "th" []->-> th :: (Functor t, Monad t) => XHtmlT t FlowContent -> XHtmlT t Table3Content-> th = th' []--<!ELEMENT td %Flow;>--> td' :: (Functor t, Monad t) => Attrs -> XHtmlT t FlowContent -> XHtmlT t Table3Content-> td' = tellNode Table3 "td" []->-> td :: (Functor t, Monad t) => XHtmlT t FlowContent -> XHtmlT t Table3Content-> td = td' []--<!ATTLIST table- %attrs;- summary %Text; #IMPLIED- width %Length; #IMPLIED- border %Pixels; #IMPLIED- frame %TFrame; #IMPLIED- rules %TRules; #IMPLIED- cellspacing %Length; #IMPLIED- cellpadding %Length; #IMPLIED- >--<!ATTLIST caption- %attrs;- >--<!---colgroup groups a set of col elements. It allows you to group-several semantically related columns together.--->-<!ATTLIST colgroup- %attrs;- span %Number; "1"- width %MultiLength; #IMPLIED- %cellhalign;- %cellvalign;- >--<!--- col elements define the alignment properties for cells in- one or more columns.-- The width attribute specifies the width of the columns, e.g.-- width=64 width in screen pixels- width=0.5* relative width of 0.5-- The span attribute causes the attributes of one- col element to apply to more than one column.--->-<!ATTLIST col- %attrs;- span %Number; "1"- width %MultiLength; #IMPLIED- %cellhalign;- %cellvalign;- >--<!--- Use thead to duplicate headers when breaking table- across page boundaries, or for static headers when- tbody sections are rendered in scrolling panel.-- Use tfoot to duplicate footers when breaking table- across page boundaries, or for static footers when- tbody sections are rendered in scrolling panel.-- Use multiple tbody sections when rules are needed- between groups of table rows.--->-<!ATTLIST thead- %attrs;- %cellhalign;- %cellvalign;- >--<!ATTLIST tfoot- %attrs;- %cellhalign;- %cellvalign;- >--<!ATTLIST tbody- %attrs;- %cellhalign;- %cellvalign;- >--<!ATTLIST tr- %attrs;- %cellhalign;- %cellvalign;- >---<!-- Scope is simpler than headers attribute for common tables -->-<!ENTITY % Scope "(row|col|rowgroup|colgroup)">--<!-- th is for headers, td for data and for cells acting as both -->--<!ATTLIST th- %attrs;- abbr %Text; #IMPLIED- axis CDATA #IMPLIED- headers IDREFS #IMPLIED- scope %Scope; #IMPLIED- rowspan %Number; "1"- colspan %Number; "1"- %cellhalign;- %cellvalign;- >--<!ATTLIST td- %attrs;- abbr %Text; #IMPLIED- axis CDATA #IMPLIED- headers IDREFS #IMPLIED- scope %Scope; #IMPLIED- rowspan %Number; "1"- colspan %Number; "1"- %cellhalign;- %cellvalign;- >
− src/Text/XHtmlCombinators/Escape.hs
@@ -1,344 +0,0 @@-{-# LANGUAGE OverloadedStrings, PatternGuards #-}---- | --- Module : Text.XHtmlCombinators.Escape--- Copyright : (c) Jasper Van der Jeugt 2009,--- (c) Alasdair Armstrong 2010--- License : BSD-style--- Maintainer : alasdair.armstrong@googlemail.com--- Stability : experimental--- Portability : GHC--- --- Escaping is based on the ESAPI project--- (see 'http://www.owasp.org/index.php/ESAPI')--module Text.XHtmlCombinators.Escape - ( escape- , escapeAttr- , escapeJavaScript- , escapeCSS- ) where--import Data.Char (toUpper)-import qualified Data.IntMap as I-import Numeric (showHex)--import Data.Text (Text)-import qualified Data.Text as T---- | Escaping text in generic HTML elements-escape :: Text -> Text-escape = escapeEntity htmlImmune- where htmlImmune = ",.-_ "- --- | Escaping text in attribute values-escapeAttr :: Text -> Text-escapeAttr = escapeEntity attributeImmune- where attributeImmune = ",.-_"---- | escaping basic text the be used inside normal HTML-elements --- based on 'http://code.google.com/p/owasp-esapi-java/source/browse/trunk/src/main/java/org/owasp/esapi/codecs/HTMLEntityCodec.java'------ Should be improved by using an array-based lookup for chars <=0xff-escapeEntity :: String -> Text -> Text-escapeEntity immune = T.concatMap $ escapeChar immune encode- where - encode c - | Just ent <- I.lookup (fromEnum c) entityMap - = T.concat ["&", ent, ";"]- | otherwise = T.pack $ concat ["&#x", hex c , ";"]- --- | Escaping text intended for places where scripts can be used -escapeJavaScript :: Text -> Text-escapeJavaScript = T.concatMap $ escapeChar javaScriptImmune encode- where - encode c - | c <= toEnum 0xff = T.pack $ concat ["\\x", pad 2 $ hex c]- | c <= toEnum 0xffff = T.pack $ concat ["\\u", pad 4 $ hex c]- | c <= toEnum 0xffffff = T.pack $ concat ["\\u", pad 6 $ hex c]- | otherwise = T.pack $ concat ["\\u", pad 8 $ hex c]- - javaScriptImmune = ",._"- - pad n hex = reverse . take n $ reverse hex ++ repeat '0'---- | Escape text for CSS (style) data -escapeCSS :: Text -> Text-escapeCSS = T.concatMap $ escapeChar "" encode- where- encode c = T.pack $ concat ["\\", hex c, " "]---- | Escape a single character -escapeChar :: - [Char] -- ^ Lists of chars to be used verbatim- -> (Char -> Text) -- ^ function handling non standard cases- -> Char -- ^ char to encode- -> Text -escapeChar immune enc c - | c `elem` immune = T.singleton c- | c >= toEnum 0x30 && c <= toEnum 0x39 = T.singleton c- | c >= toEnum 0x41 && c <= toEnum 0x5A = T.singleton c- | c >= toEnum 0x61 && c <= toEnum 0x7A = T.singleton c- | c `elem` "\t\n\r" = T.singleton c- | c <= toEnum 0x1f = " "- | c >= toEnum 0x7f && c <= toEnum 0x9f = " " - | otherwise = enc c- -hex :: Char -> String -hex c = map toUpper $ showHex (fromEnum c) [] - -entityMap :: I.IntMap Text-entityMap = I.fromList [- (34, "quot") {- quotation mark -}, - (38, "amp") {- ampersand -}, - (60, "lt") {- less-than sign -}, - (62, "gt") {- greater-than sign -}, - (160, "nbsp") {- no-break space -}, - (161, "iexcl") {- inverted exclamation mark -}, - (162, "cent") {- cent sign -}, - (163, "pound") {- pound sign -}, - (164, "curren") {- currency sign -}, - (165, "yen") {- yen sign -}, - (166, "brvbar") {- broken bar -}, - (167, "sect") {- section sign -}, - (168, "uml") {- diaeresis -}, - (169, "copy") {- copyright sign -}, - (170, "ordf") {- feminine ordinal indicator -}, - (171, "laquo") {- left-pointing double angle quotation mark -}, - (172, "not") {- not sign -}, - (173, "shy") {- soft hyphen -}, - (174, "reg") {- registered sign -}, - (175, "macr") {- macron -}, - (176, "deg") {- degree sign -}, - (177, "plusmn") {- plus-minus sign -}, - (178, "sup2") {- superscript two -}, - (179, "sup3") {- superscript three -}, - (180, "acute") {- acute accent -}, - (181, "micro") {- micro sign -}, - (182, "para") {- pilcrow sign -}, - (183, "middot") {- middle dot -}, - (184, "cedil") {- cedilla -}, - (185, "sup1") {- superscript one -}, - (186, "ordm") {- masculine ordinal indicator -}, - (187, "raquo") {- right-pointing double angle quotation mark -}, - (188, "frac14") {- vulgar fraction one quarter -}, - (189, "frac12") {- vulgar fraction one half -}, - (190, "frac34") {- vulgar fraction three quarters -}, - (191, "iquest") {- inverted question mark -}, - (192, "Agrave") {- Latin capital letter a with grave -}, - (193, "Aacute") {- Latin capital letter a with acute -}, - (194, "Acirc") {- Latin capital letter a with circumflex -}, - (195, "Atilde") {- Latin capital letter a with tilde -}, - (196, "Auml") {- Latin capital letter a with diaeresis -}, - (197, "Aring") {- Latin capital letter a with ring above -}, - (198, "AElig") {- Latin capital letter ae -}, - (199, "Ccedil") {- Latin capital letter c with cedilla -}, - (200, "Egrave") {- Latin capital letter e with grave -}, - (201, "Eacute") {- Latin capital letter e with acute -}, - (202, "Ecirc") {- Latin capital letter e with circumflex -}, - (203, "Euml") {- Latin capital letter e with diaeresis -}, - (204, "Igrave") {- Latin capital letter i with grave -}, - (205, "Iacute") {- Latin capital letter i with acute -}, - (206, "Icirc") {- Latin capital letter i with circumflex -}, - (207, "Iuml") {- Latin capital letter i with diaeresis -}, - (208, "ETH") {- Latin capital letter eth -}, - (209, "Ntilde") {- Latin capital letter n with tilde -}, - (210, "Ograve") {- Latin capital letter o with grave -}, - (211, "Oacute") {- Latin capital letter o with acute -}, - (212, "Ocirc") {- Latin capital letter o with circumflex -}, - (213, "Otilde") {- Latin capital letter o with tilde -}, - (214, "Ouml") {- Latin capital letter o with diaeresis -}, - (215, "times") {- multiplication sign -}, - (216, "Oslash") {- Latin capital letter o with stroke -}, - (217, "Ugrave") {- Latin capital letter u with grave -}, - (218, "Uacute") {- Latin capital letter u with acute -}, - (219, "Ucirc") {- Latin capital letter u with circumflex -}, - (220, "Uuml") {- Latin capital letter u with diaeresis -}, - (221, "Yacute") {- Latin capital letter y with acute -}, - (222, "THORN") {- Latin capital letter thorn -}, - (223, "szlig") {- Latin small letter sharp s, German Eszett -}, - (224, "agrave") {- Latin small letter a with grave -}, - (225, "aacute") {- Latin small letter a with acute -}, - (226, "acirc") {- Latin small letter a with circumflex -}, - (227, "atilde") {- Latin small letter a with tilde -}, - (228, "auml") {- Latin small letter a with diaeresis -}, - (229, "aring") {- Latin small letter a with ring above -}, - (230, "aelig") {- Latin lowercase ligature ae -}, - (231, "ccedil") {- Latin small letter c with cedilla -}, - (232, "egrave") {- Latin small letter e with grave -}, - (233, "eacute") {- Latin small letter e with acute -}, - (234, "ecirc") {- Latin small letter e with circumflex -}, - (235, "euml") {- Latin small letter e with diaeresis -}, - (236, "igrave") {- Latin small letter i with grave -}, - (237, "iacute") {- Latin small letter i with acute -}, - (238, "icirc") {- Latin small letter i with circumflex -}, - (239, "iuml") {- Latin small letter i with diaeresis -}, - (240, "eth") {- Latin small letter eth -}, - (241, "ntilde") {- Latin small letter n with tilde -}, - (242, "ograve") {- Latin small letter o with grave -}, - (243, "oacute") {- Latin small letter o with acute -}, - (244, "ocirc") {- Latin small letter o with circumflex -}, - (245, "otilde") {- Latin small letter o with tilde -}, - (246, "ouml") {- Latin small letter o with diaeresis -}, - (247, "divide") {- division sign -}, - (248, "oslash") {- Latin small letter o with stroke -}, - (249, "ugrave") {- Latin small letter u with grave -}, - (250, "uacute") {- Latin small letter u with acute -}, - (251, "ucirc") {- Latin small letter u with circumflex -}, - (252, "uuml") {- Latin small letter u with diaeresis -}, - (253, "yacute") {- Latin small letter y with acute -}, - (254, "thorn") {- Latin small letter thorn -}, - (255, "yuml") {- Latin small letter y with diaeresis -}, - (338, "OElig") {- Latin capital ligature oe -}, - (339, "oelig") {- Latin small ligature oe -}, - (352, "Scaron") {- Latin capital letter s with caron -}, - (353, "scaron") {- Latin small letter s with caron -}, - (376, "Yuml") {- Latin capital letter y with diaeresis -}, - (402, "fnof") {- Latin small letter f with hook -}, - (710, "circ") {- modifier letter circumflex accent -}, - (732, "tilde") {- small tilde -}, - (913, "Alpha") {- Greek capital letter alpha -}, - (914, "Beta") {- Greek capital letter beta -}, - (915, "Gamma") {- Greek capital letter gamma -}, - (916, "Delta") {- Greek capital letter delta -}, - (917, "Epsilon") {- Greek capital letter epsilon -}, - (918, "Zeta") {- Greek capital letter zeta -}, - (919, "Eta") {- Greek capital letter eta -}, - (920, "Theta") {- Greek capital letter theta -}, - (921, "Iota") {- Greek capital letter iota -}, - (922, "Kappa") {- Greek capital letter kappa -}, - (923, "Lambda") {- Greek capital letter lambda -}, - (924, "Mu") {- Greek capital letter mu -}, - (925, "Nu") {- Greek capital letter nu -}, - (926, "Xi") {- Greek capital letter xi -}, - (927, "Omicron") {- Greek capital letter omicron -}, - (928, "Pi") {- Greek capital letter pi -}, - (929, "Rho") {- Greek capital letter rho -}, - (931, "Sigma") {- Greek capital letter sigma -}, - (932, "Tau") {- Greek capital letter tau -}, - (933, "Upsilon") {- Greek capital letter upsilon -}, - (934, "Phi") {- Greek capital letter phi -}, - (935, "Chi") {- Greek capital letter chi -}, - (936, "Psi") {- Greek capital letter psi -}, - (937, "Omega") {- Greek capital letter omega -}, - (945, "alpha") {- Greek small letter alpha -}, - (946, "beta") {- Greek small letter beta -}, - (947, "gamma") {- Greek small letter gamma -}, - (948, "delta") {- Greek small letter delta -}, - (949, "epsilon") {- Greek small letter epsilon -}, - (950, "zeta") {- Greek small letter zeta -}, - (951, "eta") {- Greek small letter eta -}, - (952, "theta") {- Greek small letter theta -}, - (953, "iota") {- Greek small letter iota -}, - (954, "kappa") {- Greek small letter kappa -}, - (955, "lambda") {- Greek small letter lambda -}, - (956, "mu") {- Greek small letter mu -}, - (957, "nu") {- Greek small letter nu -}, - (958, "xi") {- Greek small letter xi -}, - (959, "omicron") {- Greek small letter omicron -}, - (960, "pi") {- Greek small letter pi -}, - (961, "rho") {- Greek small letter rho -}, - (962, "sigmaf") {- Greek small letter final sigma -}, - (963, "sigma") {- Greek small letter sigma -}, - (964, "tau") {- Greek small letter tau -}, - (965, "upsilon") {- Greek small letter upsilon -}, - (966, "phi") {- Greek small letter phi -}, - (967, "chi") {- Greek small letter chi -}, - (968, "psi") {- Greek small letter psi -}, - (969, "omega") {- Greek small letter omega -}, - (977, "thetasym") {- Greek theta symbol -}, - (978, "upsih") {- Greek upsilon with hook symbol -}, - (982, "piv") {- Greek pi symbol -}, - (8194, "ensp") {- en space -}, - (8195, "emsp") {- em space -}, - (8201, "thinsp") {- thin space -}, - (8204, "zwnj") {- zero width non-joiner -}, - (8205, "zwj") {- zero width joiner -}, - (8206, "lrm") {- left-to-right mark -}, - (8207, "rlm") {- right-to-left mark -}, - (8211, "ndash") {- en dash -}, - (8212, "mdash") {- em dash -}, - (8216, "lsquo") {- left single quotation mark -}, - (8217, "rsquo") {- right single quotation mark -}, - (8218, "sbquo") {- single low-9 quotation mark -}, - (8220, "ldquo") {- left double quotation mark -}, - (8221, "rdquo") {- right double quotation mark -}, - (8222, "bdquo") {- double low-9 quotation mark -}, - (8224, "dagger") {- dagger -}, - (8225, "Dagger") {- double dagger -}, - (8226, "bull") {- bullet -}, - (8230, "hellip") {- horizontal ellipsis -}, - (8240, "permil") {- per mille sign -}, - (8242, "prime") {- prime -}, - (8243, "Prime") {- double prime -}, - (8249, "lsaquo") {- single left-pointing angle quotation mark -}, - (8250, "rsaquo") {- single right-pointing angle quotation mark -}, - (8254, "oline") {- overline -}, - (8260, "frasl") {- fraction slash -}, - (8364, "euro") {- euro sign -}, - (8465, "image") {- black-letter capital i -}, - (8472, "weierp") {- script capital p, Weierstrass p -}, - (8476, "real") {- black-letter capital r -}, - (8482, "trade") {- trademark sign -}, - (8501, "alefsym") {- alef symbol -}, - (8592, "larr") {- leftwards arrow -}, - (8593, "uarr") {- upwards arrow -}, - (8594, "rarr") {- rightwards arrow -}, - (8595, "darr") {- downwards arrow -}, - (8596, "harr") {- left right arrow -}, - (8629, "crarr") {- downwards arrow with corner leftwards -}, - (8656, "lArr") {- leftwards double arrow -}, - (8657, "uArr") {- upwards double arrow -}, - (8658, "rArr") {- rightwards double arrow -}, - (8659, "dArr") {- downwards double arrow -}, - (8660, "hArr") {- left right double arrow -}, - (8704, "forall") {- for all -}, - (8706, "part") {- partial differential -}, - (8707, "exist") {- there exists -}, - (8709, "empty") {- empty set -}, - (8711, "nabla") {- nabla -}, - (8712, "isin") {- element of -}, - (8713, "notin") {- not an element of -}, - (8715, "ni") {- contains as member -}, - (8719, "prod") {- n-ary product -}, - (8721, "sum") {- n-ary summation -}, - (8722, "minus") {- minus sign -}, - (8727, "lowast") {- asterisk operator -}, - (8730, "radic") {- square root -}, - (8733, "prop") {- proportional to -}, - (8734, "infin") {- infinity -}, - (8736, "ang") {- angle -}, - (8743, "and") {- logical and -}, - (8744, "or") {- logical or -}, - (8745, "cap") {- intersection -}, - (8746, "cup") {- union -}, - (8747, "int") {- integral -}, - (8756, "there4") {- therefore -}, - (8764, "sim") {- tilde operator -}, - (8773, "cong") {- congruent to -}, - (8776, "asymp") {- almost equal to -}, - (8800, "ne") {- not equal to -}, - (8801, "equiv") {- identical to, equivalent to -}, - (8804, "le") {- less-than or equal to -}, - (8805, "ge") {- greater-than or equal to -}, - (8834, "sub") {- subset of -}, - (8835, "sup") {- superset of -}, - (8836, "nsub") {- not a subset of -}, - (8838, "sube") {- subset of or equal to -}, - (8839, "supe") {- superset of or equal to -}, - (8853, "oplus") {- circled plus -}, - (8855, "otimes") {- circled times -}, - (8869, "perp") {- up tack -}, - (8901, "sdot") {- dot operator -}, - (8968, "lceil") {- left ceiling -}, - (8969, "rceil") {- right ceiling -}, - (8970, "lfloor") {- left floor -}, - (8971, "rfloor") {- right floor -}, - (9001, "lang") {- left-pointing angle bracket -}, - (9002, "rang") {- right-pointing angle bracket -}, - (9674, "loz") {- lozenge -}, - (9824, "spades") {- black spade suit -}, - (9827, "clubs") {- black club suit -}, - (9829, "hearts") {- black heart suit -}, - (9830, "diams") {- black diamond suit -}] -
− src/Text/XHtmlCombinators/Extras/Lorem.hs
@@ -1,109 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}---- |--- Module : Text.XHtmlCombinators.Extras.Lorem--- Copyright : (c) Alasdair Armstrong 2010--- License : BSD-style--- Maintainer : alasdair.armstrong@googlemail.com--- Stability : experimental--- Portability : GHC--module Text.XHtmlCombinators.Extras.Lorem- ( lorem', lorem- , loremIO', loremIO- ) where--import Control.Applicative-import Control.Monad-import Control.Monad.Trans.Class-import Control.Monad.Trans.State-import Control.Monad.Trans.Writer-import Data.Monoid-import System.Random--import Data.Text (Text)-import qualified Data.Text as T--import Text.XHtmlCombinators.Internal-import Text.XHtmlCombinators.Combinators---lorem' :: Block c => Attrs -> XHtmlT (State StdGen) c-lorem' attrs = p' attrs (text =<< randomPara)--lorem :: Block c => XHtmlT (State StdGen) c-lorem = lorem' []--loremIO' :: Block c => Attrs -> XHtmlT IO c-loremIO' attrs = p' attrs (text =<< randomParaIO)--loremIO :: Block c => XHtmlT IO c-loremIO = loremIO' []--randomPara :: Monoid a => WriterT a (State StdGen) Text-randomPara = lift . fmap para $ state (randomR (1, 5))--randomParaIO :: Monoid a => WriterT a IO Text-randomParaIO = do- gen <- lift newStdGen- return . para . fst $ randomR (1, 5) gen--para :: Int -> Text--para 1 = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas in nunc\-\ sed nunc scelerisque molestie. Curabitur in mattis sem. Curabitur quis fringilla\-\ tortor. Sed rutrum vehicula diam eu ullamcorper. Vivamus ligula justo, faucibus \-\eget pretium nec, rutrum mollis quam. Nulla hendrerit, orci eu fringilla tempor, \-\risus ligula posuere metus, vitae posuere arcu est non odio. Sed sem ipsum, porta\-\ nec venenatis eget, interdum a quam. Donec et felis vitae urna dignissim digniss\-\im in at orci. Sed varius consequat dapibus. Integer tellus eros, ullamcorper et \-\ullamcorper non, consequat in ante. In ut sem ipsum. Vivamus ante orci, cursus vi\-\tae blandit dapibus, gravida vel enim. Integer volutpat ligula in lorem auctor eg\-\et ornare massa gravida. Nullam in metus diam, eget pellentesque sem. Vestibulum \-\adipiscing accumsan nibh sit amet lobortis. Vivamus a quam turpis. Proin eu sapie\-\n sapien, ut elementum ante. Sed magna eros, consectetur eget consequat nec, pell\-\entesque vitae velit. Etiam mi tortor, cursus vel tristique non, dapibus vel mi. \-\Aenean a lorem non massa porta vulputate ut nec turpis."--para 2 = "Morbi a magna nec orci cursus semper in in lacus. Ut semper tempus lacus,\-\ ut hendrerit mauris volutpat congue. In lacus turpis, tristique eu mattis ut, ti\-\ncidunt eget sem. Ut lacinia lorem at lorem mollis tristique. In nec orci aliquam\-\ enim sagittis sagittis non vitae ante. Morbi faucibus dolor ac mi lacinia tristi\-\que. Aliquam et tortor urna, vel eleifend felis. Curabitur tellus augue, interdum\-\ ac hendrerit at, volutpat tincidunt velit. In est lorem, imperdiet eget consequa\-\t sagittis, sagittis nec quam. Duis non volutpat augue."--para 3 = "Integer semper, elit eget viverra dignissim, lorem ipsum gravida tortor, \-\ut cursus orci ante a diam. Morbi non metus et sem pellentesque dapibus sed vel m\-\assa. Fusce commodo condimentum vulputate. Nullam porta, orci nec aliquam blandit\-\, orci urna sollicitudin libero, non pharetra ligula urna id nibh. In metus nulla\-\, facilisis ut tempor nec, elementum nec nunc. Aenean sapien sem, fringilla a bla\-\ndit vitae, imperdiet nec orci. Integer sit amet nunc ut dui porttitor malesuada \-\eu non mauris. Suspendisse eget diam sed dui auctor tempus eu et erat. In non lib\-\ero id purus facilisis tempus. Nulla nec tellus eget justo dignissim sagittis sit\-\ amet vitae lorem. Donec lobortis velit id massa pretium vitae tincidunt neque ul\-\trices. Duis id erat enim, ac aliquet magna. Maecenas tempus leo eget risus trist\-\ique congue eu ut turpis."--para 4 = "Ut ultrices ante nec neque suscipit ornare. Sed adipiscing diam eu enim s\-\celerisque quis rhoncus mauris pulvinar. Nulla dignissim eros a nisl posuere elei\-\fend. Nullam leo sapien, porttitor quis commodo vel, congue quis nisl. In molesti\-\e rutrum quam at malesuada. Etiam ac pretium lorem. Pellentesque nisl erat, viver\-\ra in tempus eget, pulvinar vel nisi. Curabitur odio nisl, viverra ac faucibus se\-\d, rhoncus et neque. Sed placerat dolor ante, pulvinar ultrices arcu. Nulla id le\-\o odio, ut dignissim nisi. Phasellus id tortor libero, eget aliquet sapien. Nulla\-\ facilisi. Duis ornare ultricies dolor, sed dapibus lorem sollicitudin non. Nulla\-\m augue lorem, consequat ut faucibus ac, tempus id ipsum. Fusce sit amet libero s\-\agittis dolor convallis volutpat. Aenean at elit libero. Phasellus eget odio eget\-\ mauris vehicula luctus id a est."--para 5 = "Sed purus orci, tincidunt non tincidunt a, mattis at justo. Vivamus quis \-\nisl id justo volutpat tristique. Donec mattis, neque posuere aliquam molestie, m\-\assa ipsum fringilla erat, et vehicula lorem libero quis nisi. In tellus nunc, el\-\ementum eget blandit a, pellentesque at risus. Quisque in nulla id nibh eleifend \-\ultricies viverra non felis. Aliquam tempus, libero at ullamcorper venenatis, ero\-\s mauris consectetur urna, sit amet facilisis diam eros at tellus. Vestibulum con\-\dimentum quam non est dapibus non faucibus mi luctus. Aenean quis massa nec diam \-\varius hendrerit. Morbi tempus ornare lectus et dapibus. Sed tortor tellus, lobor\-\tis a ullamcorper id, ornare nec sapien. Quisque varius feugiat ante, eu dictum e\-\nim tempus et."
+ src/Text/XHtmlCombinators/Frameset.hs view
@@ -0,0 +1,1052 @@+{-# LANGUAGE OverloadedStrings #-}+module Text.XHtmlCombinators.Frameset+ ( XHtml1+ , XHtml2+ , XHtml3+ , XHtml4+ , XHtml5+ , XHtml6+ , XHtml7+ , XHtml8+ , XHtml9+ , XHtml10+ , XHtml11+ , XHtml12+ , XHtml13+ , XHtml14+ , XHtml15+ , XHtml16+ , XHtml17+ , HtmlContent+ , HeadContent+ , BlockContent+ , FramesetContent+ , NoframesContent+ , InlineContent+ , ListContent+ , DlContent+ , AddressContent+ , PreContent+ , AContent+ , ObjectContent+ , MapContent+ , FormContent+ , SelectContent+ , OptgroupContent+ , FieldsetContent+ , ButtonContent+ , TableContent+ , TableSectionContent+ , ColgroupContent+ , TrContent+ , html', html+ , head', head_+ , title', title+ , style', style+ , script', script+ , option', option+ , textarea', textarea+ , base', base+ , meta', meta+ , link', link+ , frame', frame+ , hr', hr+ , br', br+ , basefont', basefont+ , param', param+ , img', img+ , area', area+ , input', input+ , isindex', isindex+ , col', col+ , noscript', noscript+ , iframe', iframe+ , body', body+ , div', div_+ , li', li+ , dd', dd+ , blockquote', blockquote+ , center', center+ , ins', ins+ , del', del+ , th', th+ , td', td+ , frameset', frameset+ , noframes', noframes+ , p', p+ , h1', h1+ , h2', h2+ , h3', h3+ , h4', h4+ , h5', h5+ , h6', h6+ , dt', dt+ , span', span_+ , bdo', bdo+ , em', em+ , strong', strong+ , dfn', dfn+ , code', code+ , samp', samp+ , kbd', kbd+ , var', var+ , cite', cite+ , abbr', abbr+ , acronym', acronym+ , q', q+ , sub', sub+ , sup', sup+ , tt', tt+ , i', i+ , b', b+ , big', big+ , small', small+ , u', u+ , s', s+ , strike', strike+ , font', font+ , label', label+ , legend', legend+ , caption', caption+ , ul', ul+ , ol', ol+ , menu', menu+ , dir', dir+ , dl', dl+ , address', address+ , pre', pre+ , a', a+ , object', object+ , applet', applet+ , map', map_+ , form', form+ , select', select+ , optgroup', optgroup+ , fieldset', fieldset+ , button', button+ , table', table+ , thead', thead+ , tfoot', tfoot+ , tbody', tbody+ , colgroup', colgroup+ , tr', tr+ ) where++import Data.Text (Text)++import Text.XHtmlCombinators.Internal+import qualified Text.XHtmlCombinators.Frameset.Attributes as A++class XHtml1 c where+ xhtml1 :: Node -> c++instance XHtml1 HeadContent where xhtml1 = Head+instance XHtml1 BlockContent where xhtml1 = Block+instance XHtml1 InlineContent where xhtml1 = Inline+instance XHtml1 AddressContent where xhtml1 = Address+instance XHtml1 PreContent where xhtml1 = Pre+instance XHtml1 AContent where xhtml1 = A+instance XHtml1 ObjectContent where xhtml1 = Object+instance XHtml1 MapContent where xhtml1 = Map+instance XHtml1 FormContent where xhtml1 = Form+instance XHtml1 FieldsetContent where xhtml1 = Fieldset+instance XHtml1 ButtonContent where xhtml1 = Button++class XHtml2 c where+ xhtml2 :: Node -> c++instance XHtml2 SelectContent where xhtml2 = Select+instance XHtml2 OptgroupContent where xhtml2 = Optgroup++class XHtml3 c where+ xhtml3 :: Node -> c++instance XHtml3 BlockContent where xhtml3 = Block+instance XHtml3 InlineContent where xhtml3 = Inline+instance XHtml3 AddressContent where xhtml3 = Address+instance XHtml3 PreContent where xhtml3 = Pre+instance XHtml3 AContent where xhtml3 = A+instance XHtml3 ObjectContent where xhtml3 = Object+instance XHtml3 FormContent where xhtml3 = Form+instance XHtml3 FieldsetContent where xhtml3 = Fieldset++class XHtml4 c where+ xhtml4 :: Node -> c++instance XHtml4 BlockContent where xhtml4 = Block+instance XHtml4 ObjectContent where xhtml4 = Object+instance XHtml4 MapContent where xhtml4 = Map+instance XHtml4 FormContent where xhtml4 = Form+instance XHtml4 FieldsetContent where xhtml4 = Fieldset+instance XHtml4 ButtonContent where xhtml4 = Button++class XHtml5 c where+ xhtml5 :: Node -> c++instance XHtml5 BlockContent where xhtml5 = Block+instance XHtml5 InlineContent where xhtml5 = Inline+instance XHtml5 AddressContent where xhtml5 = Address+instance XHtml5 PreContent where xhtml5 = Pre+instance XHtml5 AContent where xhtml5 = A+instance XHtml5 ObjectContent where xhtml5 = Object+instance XHtml5 FormContent where xhtml5 = Form+instance XHtml5 FieldsetContent where xhtml5 = Fieldset+instance XHtml5 ButtonContent where xhtml5 = Button++class XHtml6 c where+ xhtml6 :: Node -> c++instance XHtml6 BlockContent where xhtml6 = Block+instance XHtml6 InlineContent where xhtml6 = Inline+instance XHtml6 AddressContent where xhtml6 = Address+instance XHtml6 AContent where xhtml6 = A+instance XHtml6 ObjectContent where xhtml6 = Object+instance XHtml6 FormContent where xhtml6 = Form+instance XHtml6 FieldsetContent where xhtml6 = Fieldset+instance XHtml6 ButtonContent where xhtml6 = Button++class XHtml7 c where+ xhtml7 :: Node -> c++instance XHtml7 HeadContent where xhtml7 = Head+instance XHtml7 BlockContent where xhtml7 = Block+instance XHtml7 ObjectContent where xhtml7 = Object+instance XHtml7 MapContent where xhtml7 = Map+instance XHtml7 FormContent where xhtml7 = Form+instance XHtml7 FieldsetContent where xhtml7 = Fieldset++class XHtml8 c where+ xhtml8 :: Node -> c++instance XHtml8 TableContent where xhtml8 = Table+instance XHtml8 ColgroupContent where xhtml8 = Colgroup++class XHtml9 c where+ xhtml9 :: Node -> c++instance XHtml9 BlockContent where xhtml9 = Block+instance XHtml9 InlineContent where xhtml9 = Inline+instance XHtml9 AddressContent where xhtml9 = Address+instance XHtml9 AContent where xhtml9 = A+instance XHtml9 ObjectContent where xhtml9 = Object+instance XHtml9 FormContent where xhtml9 = Form+instance XHtml9 FieldsetContent where xhtml9 = Fieldset++class XHtml10 c where+ xhtml10 :: Node -> c++instance XHtml10 BlockContent where xhtml10 = Block+instance XHtml10 InlineContent where xhtml10 = Inline+instance XHtml10 AddressContent where xhtml10 = Address+instance XHtml10 PreContent where xhtml10 = Pre+instance XHtml10 AContent where xhtml10 = A+instance XHtml10 ObjectContent where xhtml10 = Object+instance XHtml10 MapContent where xhtml10 = Map+instance XHtml10 FormContent where xhtml10 = Form+instance XHtml10 FieldsetContent where xhtml10 = Fieldset+instance XHtml10 ButtonContent where xhtml10 = Button++class XHtml11 c where+ xhtml11 :: Node -> c++instance XHtml11 HtmlContent where xhtml11 = Html+instance XHtml11 FramesetContent where xhtml11 = Frameset++class XHtml12 c where+ xhtml12 :: Node -> c++instance XHtml12 BlockContent where xhtml12 = Block+instance XHtml12 AddressContent where xhtml12 = Address+instance XHtml12 ObjectContent where xhtml12 = Object+instance XHtml12 MapContent where xhtml12 = Map+instance XHtml12 FormContent where xhtml12 = Form+instance XHtml12 FieldsetContent where xhtml12 = Fieldset+instance XHtml12 ButtonContent where xhtml12 = Button++class XHtml13 c where+ xhtml13 :: Node -> c++instance XHtml13 BlockContent where xhtml13 = Block+instance XHtml13 InlineContent where xhtml13 = Inline+instance XHtml13 AddressContent where xhtml13 = Address+instance XHtml13 PreContent where xhtml13 = Pre+instance XHtml13 ObjectContent where xhtml13 = Object+instance XHtml13 FormContent where xhtml13 = Form+instance XHtml13 FieldsetContent where xhtml13 = Fieldset++class XHtml14 c where+ xhtml14 :: Node -> c++instance XHtml14 HeadContent where xhtml14 = Head+instance XHtml14 BlockContent where xhtml14 = Block+instance XHtml14 InlineContent where xhtml14 = Inline+instance XHtml14 AddressContent where xhtml14 = Address+instance XHtml14 AContent where xhtml14 = A+instance XHtml14 ObjectContent where xhtml14 = Object+instance XHtml14 FormContent where xhtml14 = Form+instance XHtml14 FieldsetContent where xhtml14 = Fieldset+instance XHtml14 ButtonContent where xhtml14 = Button++class XHtml15 c where+ xhtml15 :: Node -> c++instance XHtml15 BlockContent where xhtml15 = Block+instance XHtml15 ObjectContent where xhtml15 = Object+instance XHtml15 MapContent where xhtml15 = Map+instance XHtml15 FieldsetContent where xhtml15 = Fieldset++class XHtml16 c where+ xhtml16 :: Node -> c++instance XHtml16 BlockContent where xhtml16 = Block+instance XHtml16 ObjectContent where xhtml16 = Object+instance XHtml16 MapContent where xhtml16 = Map+instance XHtml16 FormContent where xhtml16 = Form+instance XHtml16 FieldsetContent where xhtml16 = Fieldset++class XHtml17 c where+ xhtml17 :: Node -> c++instance XHtml17 TableContent where xhtml17 = Table+instance XHtml17 TableSectionContent where xhtml17 = TableSection++newtype HtmlContent = Html { htmlToNode :: Node }++instance Content HtmlContent where+ toContent = htmlToNode++html' :: (Functor t, Monad t) => Attrs -> XHtmlT t HtmlContent -> XHtmlT t Root+html' = tellNode Root "html" []++html :: (Functor t, Monad t) => XHtmlT t HtmlContent -> XHtmlT t Root+html = tellNode Root "html" [] []++newtype HeadContent = Head { headToNode :: Node }++instance Content HeadContent where+ toContent = headToNode++head' :: (Functor t, Monad t) => Attrs -> XHtmlT t HeadContent -> XHtmlT t HtmlContent+head' = tellNode Html "head" []++head_ :: (Functor t, Monad t) => XHtmlT t HeadContent -> XHtmlT t HtmlContent+head_ = tellNode Html "head" [] []++title' :: (Functor t, Monad t) => Attrs -> Text -> XHtmlT t HeadContent+title' = tellTextNode Head "title" []++title :: (Functor t, Monad t) => Text -> XHtmlT t HeadContent+title = tellTextNode Head "title" [] []++style' :: (Functor t, Monad t)+ => Text -- ^ Required type attribute.+ -> Attrs -> Text -> XHtmlT t HeadContent+style' a = tellTextNode Head "style" [A.type_ a]++style :: (Functor t, Monad t)+ => Text -- ^ Required type attribute.+ -> Text -> XHtmlT t HeadContent+style a = tellTextNode Head "style" [A.type_ a] []++script' :: (Functor t, Monad t, XHtml1 c)+ => Text -- ^ Required type attribute.+ -> Attrs -> Text -> XHtmlT t c+script' a = tellTextNode xhtml1 "script" [A.type_ a]++script :: (Functor t, Monad t, XHtml1 c)+ => Text -- ^ Required type attribute.+ -> Text -> XHtmlT t c+script a = tellTextNode xhtml1 "script" [A.type_ a] []++option' :: (Functor t, Monad t, XHtml2 c) => Attrs -> Text -> XHtmlT t c+option' = tellTextNode xhtml2 "option" []++option :: (Functor t, Monad t, XHtml2 c) => Text -> XHtmlT t c+option = tellTextNode xhtml2 "option" [] []++textarea' :: (Functor t, Monad t, XHtml3 c)+ => Text -- ^ Required rows attribute.+ -> Text -- ^ Required cols attribute.+ -> Attrs -> Text -> XHtmlT t c+textarea' a b = tellTextNode xhtml3 "textarea" [A.rows a, A.cols b]++textarea :: (Functor t, Monad t, XHtml3 c)+ => Text -- ^ Required rows attribute.+ -> Text -- ^ Required cols attribute.+ -> Text -> XHtmlT t c+textarea a b = tellTextNode xhtml3 "textarea" [A.rows a, A.cols b] []++base' :: (Functor t, Monad t) => Attrs -> XHtmlT t HeadContent+base' = tellEmptyNode Head "base" []++base :: (Functor t, Monad t) => XHtmlT t HeadContent+base = tellEmptyNode Head "base" [] []++meta' :: (Functor t, Monad t)+ => Text -- ^ Required content attribute.+ -> Attrs -> XHtmlT t HeadContent+meta' a = tellEmptyNode Head "meta" [A.content a]++meta :: (Functor t, Monad t)+ => Text -- ^ Required content attribute.+ -> XHtmlT t HeadContent+meta a = tellEmptyNode Head "meta" [A.content a] []++link' :: (Functor t, Monad t) => Attrs -> XHtmlT t HeadContent+link' = tellEmptyNode Head "link" []++link :: (Functor t, Monad t) => XHtmlT t HeadContent+link = tellEmptyNode Head "link" [] []++frame' :: (Functor t, Monad t) => Attrs -> XHtmlT t FramesetContent+frame' = tellEmptyNode Frameset "frame" []++frame :: (Functor t, Monad t) => XHtmlT t FramesetContent+frame = tellEmptyNode Frameset "frame" [] []++hr' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t c+hr' = tellEmptyNode xhtml4 "hr" []++hr :: (Functor t, Monad t, XHtml4 c) => XHtmlT t c+hr = tellEmptyNode xhtml4 "hr" [] []++br' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t c+br' = tellEmptyNode xhtml5 "br" []++br :: (Functor t, Monad t, XHtml5 c) => XHtmlT t c+br = tellEmptyNode xhtml5 "br" [] []++basefont' :: (Functor t, Monad t, XHtml6 c)+ => Text -- ^ Required size attribute.+ -> Attrs -> XHtmlT t c+basefont' a = tellEmptyNode xhtml6 "basefont" [A.size a]++basefont :: (Functor t, Monad t, XHtml6 c)+ => Text -- ^ Required size attribute.+ -> XHtmlT t c+basefont a = tellEmptyNode xhtml6 "basefont" [A.size a] []++param' :: (Functor t, Monad t)+ => Text -- ^ Required name attribute.+ -> Attrs -> XHtmlT t ObjectContent+param' a = tellEmptyNode Object "param" [A.name a]++param :: (Functor t, Monad t)+ => Text -- ^ Required name attribute.+ -> XHtmlT t ObjectContent+param a = tellEmptyNode Object "param" [A.name a] []++img' :: (Functor t, Monad t, XHtml6 c)+ => Text -- ^ Required src attribute.+ -> Text -- ^ Required alt attribute.+ -> Attrs -> XHtmlT t c+img' a b = tellEmptyNode xhtml6 "img" [A.src a, A.alt b]++img :: (Functor t, Monad t, XHtml6 c)+ => Text -- ^ Required src attribute.+ -> Text -- ^ Required alt attribute.+ -> XHtmlT t c+img a b = tellEmptyNode xhtml6 "img" [A.src a, A.alt b] []++area' :: (Functor t, Monad t)+ => Text -- ^ Required alt attribute.+ -> Attrs -> XHtmlT t MapContent+area' a = tellEmptyNode Map "area" [A.alt a]++area :: (Functor t, Monad t)+ => Text -- ^ Required alt attribute.+ -> XHtmlT t MapContent+area a = tellEmptyNode Map "area" [A.alt a] []++input' :: (Functor t, Monad t, XHtml3 c) => Attrs -> XHtmlT t c+input' = tellEmptyNode xhtml3 "input" []++input :: (Functor t, Monad t, XHtml3 c) => XHtmlT t c+input = tellEmptyNode xhtml3 "input" [] []++isindex' :: (Functor t, Monad t, XHtml7 c) => Attrs -> XHtmlT t c+isindex' = tellEmptyNode xhtml7 "isindex" []++isindex :: (Functor t, Monad t, XHtml7 c) => XHtmlT t c+isindex = tellEmptyNode xhtml7 "isindex" [] []++col' :: (Functor t, Monad t, XHtml8 c) => Attrs -> XHtmlT t c+col' = tellEmptyNode xhtml8 "col" []++col :: (Functor t, Monad t, XHtml8 c) => XHtmlT t c+col = tellEmptyNode xhtml8 "col" [] []++newtype BlockContent = Block { blockToNode :: Node }++instance Content BlockContent where+ toContent = blockToNode++instance CData BlockContent where+ cdata = Block . TextNode++noscript' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t BlockContent -> XHtmlT t c+noscript' = tellNode xhtml4 "noscript" []++noscript :: (Functor t, Monad t, XHtml4 c) => XHtmlT t BlockContent -> XHtmlT t c+noscript = tellNode xhtml4 "noscript" [] []++iframe' :: (Functor t, Monad t, XHtml9 c) => Attrs -> XHtmlT t BlockContent -> XHtmlT t c+iframe' = tellNode xhtml9 "iframe" []++iframe :: (Functor t, Monad t, XHtml9 c) => XHtmlT t BlockContent -> XHtmlT t c+iframe = tellNode xhtml9 "iframe" [] []++body' :: (Functor t, Monad t) => Attrs -> XHtmlT t BlockContent -> XHtmlT t NoframesContent+body' = tellNode Noframes "body" []++body :: (Functor t, Monad t) => XHtmlT t BlockContent -> XHtmlT t NoframesContent+body = tellNode Noframes "body" [] []++div' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t BlockContent -> XHtmlT t c+div' = tellNode xhtml4 "div" []++div_ :: (Functor t, Monad t, XHtml4 c) => XHtmlT t BlockContent -> XHtmlT t c+div_ = tellNode xhtml4 "div" [] []++li' :: (Functor t, Monad t) => Attrs -> XHtmlT t BlockContent -> XHtmlT t ListContent+li' = tellNode List "li" []++li :: (Functor t, Monad t) => XHtmlT t BlockContent -> XHtmlT t ListContent+li = tellNode List "li" [] []++dd' :: (Functor t, Monad t) => Attrs -> XHtmlT t BlockContent -> XHtmlT t DlContent+dd' = tellNode Dl "dd" []++dd :: (Functor t, Monad t) => XHtmlT t BlockContent -> XHtmlT t DlContent+dd = tellNode Dl "dd" [] []++blockquote' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t BlockContent -> XHtmlT t c+blockquote' = tellNode xhtml4 "blockquote" []++blockquote :: (Functor t, Monad t, XHtml4 c) => XHtmlT t BlockContent -> XHtmlT t c+blockquote = tellNode xhtml4 "blockquote" [] []++center' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t BlockContent -> XHtmlT t c+center' = tellNode xhtml4 "center" []++center :: (Functor t, Monad t, XHtml4 c) => XHtmlT t BlockContent -> XHtmlT t c+center = tellNode xhtml4 "center" [] []++ins' :: (Functor t, Monad t, XHtml10 c) => Attrs -> XHtmlT t BlockContent -> XHtmlT t c+ins' = tellNode xhtml10 "ins" []++ins :: (Functor t, Monad t, XHtml10 c) => XHtmlT t BlockContent -> XHtmlT t c+ins = tellNode xhtml10 "ins" [] []++del' :: (Functor t, Monad t, XHtml10 c) => Attrs -> XHtmlT t BlockContent -> XHtmlT t c+del' = tellNode xhtml10 "del" []++del :: (Functor t, Monad t, XHtml10 c) => XHtmlT t BlockContent -> XHtmlT t c+del = tellNode xhtml10 "del" [] []++th' :: (Functor t, Monad t) => Attrs -> XHtmlT t BlockContent -> XHtmlT t TrContent+th' = tellNode Tr "th" []++th :: (Functor t, Monad t) => XHtmlT t BlockContent -> XHtmlT t TrContent+th = tellNode Tr "th" [] []++td' :: (Functor t, Monad t) => Attrs -> XHtmlT t BlockContent -> XHtmlT t TrContent+td' = tellNode Tr "td" []++td :: (Functor t, Monad t) => XHtmlT t BlockContent -> XHtmlT t TrContent+td = tellNode Tr "td" [] []++newtype FramesetContent = Frameset { framesetToNode :: Node }++instance Content FramesetContent where+ toContent = framesetToNode++frameset' :: (Functor t, Monad t, XHtml11 c) => Attrs -> XHtmlT t FramesetContent -> XHtmlT t c+frameset' = tellNode xhtml11 "frameset" []++frameset :: (Functor t, Monad t, XHtml11 c) => XHtmlT t FramesetContent -> XHtmlT t c+frameset = tellNode xhtml11 "frameset" [] []++newtype NoframesContent = Noframes { noframesToNode :: Node }++instance Content NoframesContent where+ toContent = noframesToNode++noframes' :: (Functor t, Monad t) => Attrs -> XHtmlT t NoframesContent -> XHtmlT t FramesetContent+noframes' = tellNode Frameset "noframes" []++noframes :: (Functor t, Monad t) => XHtmlT t NoframesContent -> XHtmlT t FramesetContent+noframes = tellNode Frameset "noframes" [] []++newtype InlineContent = Inline { inlineToNode :: Node }++instance Content InlineContent where+ toContent = inlineToNode++instance CData InlineContent where+ cdata = Inline . TextNode++p' :: (Functor t, Monad t, XHtml12 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+p' = tellNode xhtml12 "p" []++p :: (Functor t, Monad t, XHtml12 c) => XHtmlT t InlineContent -> XHtmlT t c+p = tellNode xhtml12 "p" [] []++h1' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+h1' = tellNode xhtml4 "h1" []++h1 :: (Functor t, Monad t, XHtml4 c) => XHtmlT t InlineContent -> XHtmlT t c+h1 = tellNode xhtml4 "h1" [] []++h2' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+h2' = tellNode xhtml4 "h2" []++h2 :: (Functor t, Monad t, XHtml4 c) => XHtmlT t InlineContent -> XHtmlT t c+h2 = tellNode xhtml4 "h2" [] []++h3' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+h3' = tellNode xhtml4 "h3" []++h3 :: (Functor t, Monad t, XHtml4 c) => XHtmlT t InlineContent -> XHtmlT t c+h3 = tellNode xhtml4 "h3" [] []++h4' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+h4' = tellNode xhtml4 "h4" []++h4 :: (Functor t, Monad t, XHtml4 c) => XHtmlT t InlineContent -> XHtmlT t c+h4 = tellNode xhtml4 "h4" [] []++h5' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+h5' = tellNode xhtml4 "h5" []++h5 :: (Functor t, Monad t, XHtml4 c) => XHtmlT t InlineContent -> XHtmlT t c+h5 = tellNode xhtml4 "h5" [] []++h6' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+h6' = tellNode xhtml4 "h6" []++h6 :: (Functor t, Monad t, XHtml4 c) => XHtmlT t InlineContent -> XHtmlT t c+h6 = tellNode xhtml4 "h6" [] []++dt' :: (Functor t, Monad t) => Attrs -> XHtmlT t InlineContent -> XHtmlT t DlContent+dt' = tellNode Dl "dt" []++dt :: (Functor t, Monad t) => XHtmlT t InlineContent -> XHtmlT t DlContent+dt = tellNode Dl "dt" [] []++span' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+span' = tellNode xhtml5 "span" []++span_ :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+span_ = tellNode xhtml5 "span" [] []++bdo' :: (Functor t, Monad t, XHtml5 c)+ => Text -- ^ Required dir attribute.+ -> Attrs -> XHtmlT t InlineContent -> XHtmlT t c+bdo' a = tellNode xhtml5 "bdo" [A.dir a]++bdo :: (Functor t, Monad t, XHtml5 c)+ => Text -- ^ Required dir attribute.+ -> XHtmlT t InlineContent -> XHtmlT t c+bdo a = tellNode xhtml5 "bdo" [A.dir a] []++em' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+em' = tellNode xhtml5 "em" []++em :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+em = tellNode xhtml5 "em" [] []++strong' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+strong' = tellNode xhtml5 "strong" []++strong :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+strong = tellNode xhtml5 "strong" [] []++dfn' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+dfn' = tellNode xhtml5 "dfn" []++dfn :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+dfn = tellNode xhtml5 "dfn" [] []++code' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+code' = tellNode xhtml5 "code" []++code :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+code = tellNode xhtml5 "code" [] []++samp' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+samp' = tellNode xhtml5 "samp" []++samp :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+samp = tellNode xhtml5 "samp" [] []++kbd' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+kbd' = tellNode xhtml5 "kbd" []++kbd :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+kbd = tellNode xhtml5 "kbd" [] []++var' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+var' = tellNode xhtml5 "var" []++var :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+var = tellNode xhtml5 "var" [] []++cite' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+cite' = tellNode xhtml5 "cite" []++cite :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+cite = tellNode xhtml5 "cite" [] []++abbr' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+abbr' = tellNode xhtml5 "abbr" []++abbr :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+abbr = tellNode xhtml5 "abbr" [] []++acronym' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+acronym' = tellNode xhtml5 "acronym" []++acronym :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+acronym = tellNode xhtml5 "acronym" [] []++q' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+q' = tellNode xhtml5 "q" []++q :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+q = tellNode xhtml5 "q" [] []++sub' :: (Functor t, Monad t, XHtml6 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+sub' = tellNode xhtml6 "sub" []++sub :: (Functor t, Monad t, XHtml6 c) => XHtmlT t InlineContent -> XHtmlT t c+sub = tellNode xhtml6 "sub" [] []++sup' :: (Functor t, Monad t, XHtml6 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+sup' = tellNode xhtml6 "sup" []++sup :: (Functor t, Monad t, XHtml6 c) => XHtmlT t InlineContent -> XHtmlT t c+sup = tellNode xhtml6 "sup" [] []++tt' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+tt' = tellNode xhtml5 "tt" []++tt :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+tt = tellNode xhtml5 "tt" [] []++i' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+i' = tellNode xhtml5 "i" []++i :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+i = tellNode xhtml5 "i" [] []++b' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+b' = tellNode xhtml5 "b" []++b :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+b = tellNode xhtml5 "b" [] []++big' :: (Functor t, Monad t, XHtml6 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+big' = tellNode xhtml6 "big" []++big :: (Functor t, Monad t, XHtml6 c) => XHtmlT t InlineContent -> XHtmlT t c+big = tellNode xhtml6 "big" [] []++small' :: (Functor t, Monad t, XHtml6 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+small' = tellNode xhtml6 "small" []++small :: (Functor t, Monad t, XHtml6 c) => XHtmlT t InlineContent -> XHtmlT t c+small = tellNode xhtml6 "small" [] []++u' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+u' = tellNode xhtml5 "u" []++u :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+u = tellNode xhtml5 "u" [] []++s' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+s' = tellNode xhtml5 "s" []++s :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+s = tellNode xhtml5 "s" [] []++strike' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+strike' = tellNode xhtml5 "strike" []++strike :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+strike = tellNode xhtml5 "strike" [] []++font' :: (Functor t, Monad t, XHtml6 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+font' = tellNode xhtml6 "font" []++font :: (Functor t, Monad t, XHtml6 c) => XHtmlT t InlineContent -> XHtmlT t c+font = tellNode xhtml6 "font" [] []++label' :: (Functor t, Monad t, XHtml3 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+label' = tellNode xhtml3 "label" []++label :: (Functor t, Monad t, XHtml3 c) => XHtmlT t InlineContent -> XHtmlT t c+label = tellNode xhtml3 "label" [] []++legend' :: (Functor t, Monad t) => Attrs -> XHtmlT t InlineContent -> XHtmlT t FieldsetContent+legend' = tellNode Fieldset "legend" []++legend :: (Functor t, Monad t) => XHtmlT t InlineContent -> XHtmlT t FieldsetContent+legend = tellNode Fieldset "legend" [] []++caption' :: (Functor t, Monad t) => Attrs -> XHtmlT t InlineContent -> XHtmlT t TableContent+caption' = tellNode Table "caption" []++caption :: (Functor t, Monad t) => XHtmlT t InlineContent -> XHtmlT t TableContent+caption = tellNode Table "caption" [] []++newtype ListContent = List { listToNode :: Node }++instance Content ListContent where+ toContent = listToNode++ul' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t ListContent -> XHtmlT t c+ul' = tellNode xhtml4 "ul" []++ul :: (Functor t, Monad t, XHtml4 c) => XHtmlT t ListContent -> XHtmlT t c+ul = tellNode xhtml4 "ul" [] []++ol' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t ListContent -> XHtmlT t c+ol' = tellNode xhtml4 "ol" []++ol :: (Functor t, Monad t, XHtml4 c) => XHtmlT t ListContent -> XHtmlT t c+ol = tellNode xhtml4 "ol" [] []++menu' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t ListContent -> XHtmlT t c+menu' = tellNode xhtml4 "menu" []++menu :: (Functor t, Monad t, XHtml4 c) => XHtmlT t ListContent -> XHtmlT t c+menu = tellNode xhtml4 "menu" [] []++dir' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t ListContent -> XHtmlT t c+dir' = tellNode xhtml4 "dir" []++dir :: (Functor t, Monad t, XHtml4 c) => XHtmlT t ListContent -> XHtmlT t c+dir = tellNode xhtml4 "dir" [] []++newtype DlContent = Dl { dlToNode :: Node }++instance Content DlContent where+ toContent = dlToNode++dl' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t DlContent -> XHtmlT t c+dl' = tellNode xhtml4 "dl" []++dl :: (Functor t, Monad t, XHtml4 c) => XHtmlT t DlContent -> XHtmlT t c+dl = tellNode xhtml4 "dl" [] []++newtype AddressContent = Address { addressToNode :: Node }++instance Content AddressContent where+ toContent = addressToNode++instance CData AddressContent where+ cdata = Address . TextNode++address' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t AddressContent -> XHtmlT t c+address' = tellNode xhtml4 "address" []++address :: (Functor t, Monad t, XHtml4 c) => XHtmlT t AddressContent -> XHtmlT t c+address = tellNode xhtml4 "address" [] []++newtype PreContent = Pre { preToNode :: Node }++instance Content PreContent where+ toContent = preToNode++instance CData PreContent where+ cdata = Pre . TextNode++pre' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t PreContent -> XHtmlT t c+pre' = tellNode xhtml4 "pre" []++pre :: (Functor t, Monad t, XHtml4 c) => XHtmlT t PreContent -> XHtmlT t c+pre = tellNode xhtml4 "pre" [] []++newtype AContent = A { aToNode :: Node }++instance Content AContent where+ toContent = aToNode++instance CData AContent where+ cdata = A . TextNode++a' :: (Functor t, Monad t, XHtml13 c) => Attrs -> XHtmlT t AContent -> XHtmlT t c+a' = tellNode xhtml13 "a" []++a :: (Functor t, Monad t, XHtml13 c) => XHtmlT t AContent -> XHtmlT t c+a = tellNode xhtml13 "a" [] []++newtype ObjectContent = Object { objectToNode :: Node }++instance Content ObjectContent where+ toContent = objectToNode++instance CData ObjectContent where+ cdata = Object . TextNode++object' :: (Functor t, Monad t, XHtml14 c) => Attrs -> XHtmlT t ObjectContent -> XHtmlT t c+object' = tellNode xhtml14 "object" []++object :: (Functor t, Monad t, XHtml14 c) => XHtmlT t ObjectContent -> XHtmlT t c+object = tellNode xhtml14 "object" [] []++applet' :: (Functor t, Monad t, XHtml6 c)+ => Text -- ^ Required width attribute.+ -> Text -- ^ Required height attribute.+ -> Attrs -> XHtmlT t ObjectContent -> XHtmlT t c+applet' a b = tellNode xhtml6 "applet" [A.width a, A.height b]++applet :: (Functor t, Monad t, XHtml6 c)+ => Text -- ^ Required width attribute.+ -> Text -- ^ Required height attribute.+ -> XHtmlT t ObjectContent -> XHtmlT t c+applet a b = tellNode xhtml6 "applet" [A.width a, A.height b] []++newtype MapContent = Map { mapToNode :: Node }++instance Content MapContent where+ toContent = mapToNode++map' :: (Functor t, Monad t, XHtml6 c)+ => Text -- ^ Required id attribute.+ -> Attrs -> XHtmlT t MapContent -> XHtmlT t c+map' a = tellNode xhtml6 "map" [A.id a]++map_ :: (Functor t, Monad t, XHtml6 c)+ => Text -- ^ Required id attribute.+ -> XHtmlT t MapContent -> XHtmlT t c+map_ a = tellNode xhtml6 "map" [A.id a] []++newtype FormContent = Form { formToNode :: Node }++instance Content FormContent where+ toContent = formToNode++instance CData FormContent where+ cdata = Form . TextNode++form' :: (Functor t, Monad t, XHtml15 c)+ => Text -- ^ Required action attribute.+ -> Attrs -> XHtmlT t FormContent -> XHtmlT t c+form' a = tellNode xhtml15 "form" [A.action a]++form :: (Functor t, Monad t, XHtml15 c)+ => Text -- ^ Required action attribute.+ -> XHtmlT t FormContent -> XHtmlT t c+form a = tellNode xhtml15 "form" [A.action a] []++newtype SelectContent = Select { selectToNode :: Node }++instance Content SelectContent where+ toContent = selectToNode++select' :: (Functor t, Monad t, XHtml3 c) => Attrs -> XHtmlT t SelectContent -> XHtmlT t c+select' = tellNode xhtml3 "select" []++select :: (Functor t, Monad t, XHtml3 c) => XHtmlT t SelectContent -> XHtmlT t c+select = tellNode xhtml3 "select" [] []++newtype OptgroupContent = Optgroup { optgroupToNode :: Node }++instance Content OptgroupContent where+ toContent = optgroupToNode++optgroup' :: (Functor t, Monad t)+ => Text -- ^ Required label attribute.+ -> Attrs -> XHtmlT t OptgroupContent -> XHtmlT t SelectContent+optgroup' a = tellNode Select "optgroup" [A.label a]++optgroup :: (Functor t, Monad t)+ => Text -- ^ Required label attribute.+ -> XHtmlT t OptgroupContent -> XHtmlT t SelectContent+optgroup a = tellNode Select "optgroup" [A.label a] []++newtype FieldsetContent = Fieldset { fieldsetToNode :: Node }++instance Content FieldsetContent where+ toContent = fieldsetToNode++instance CData FieldsetContent where+ cdata = Fieldset . TextNode++fieldset' :: (Functor t, Monad t, XHtml16 c) => Attrs -> XHtmlT t FieldsetContent -> XHtmlT t c+fieldset' = tellNode xhtml16 "fieldset" []++fieldset :: (Functor t, Monad t, XHtml16 c) => XHtmlT t FieldsetContent -> XHtmlT t c+fieldset = tellNode xhtml16 "fieldset" [] []++newtype ButtonContent = Button { buttonToNode :: Node }++instance Content ButtonContent where+ toContent = buttonToNode++instance CData ButtonContent where+ cdata = Button . TextNode++button' :: (Functor t, Monad t, XHtml3 c) => Attrs -> XHtmlT t ButtonContent -> XHtmlT t c+button' = tellNode xhtml3 "button" []++button :: (Functor t, Monad t, XHtml3 c) => XHtmlT t ButtonContent -> XHtmlT t c+button = tellNode xhtml3 "button" [] []++newtype TableContent = Table { tableToNode :: Node }++instance Content TableContent where+ toContent = tableToNode++table' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t TableContent -> XHtmlT t c+table' = tellNode xhtml4 "table" []++table :: (Functor t, Monad t, XHtml4 c) => XHtmlT t TableContent -> XHtmlT t c+table = tellNode xhtml4 "table" [] []++newtype TableSectionContent = TableSection { tablesectionToNode :: Node }++instance Content TableSectionContent where+ toContent = tablesectionToNode++thead' :: (Functor t, Monad t) => Attrs -> XHtmlT t TableSectionContent -> XHtmlT t TableContent+thead' = tellNode Table "thead" []++thead :: (Functor t, Monad t) => XHtmlT t TableSectionContent -> XHtmlT t TableContent+thead = tellNode Table "thead" [] []++tfoot' :: (Functor t, Monad t) => Attrs -> XHtmlT t TableSectionContent -> XHtmlT t TableContent+tfoot' = tellNode Table "tfoot" []++tfoot :: (Functor t, Monad t) => XHtmlT t TableSectionContent -> XHtmlT t TableContent+tfoot = tellNode Table "tfoot" [] []++tbody' :: (Functor t, Monad t) => Attrs -> XHtmlT t TableSectionContent -> XHtmlT t TableContent+tbody' = tellNode Table "tbody" []++tbody :: (Functor t, Monad t) => XHtmlT t TableSectionContent -> XHtmlT t TableContent+tbody = tellNode Table "tbody" [] []++newtype ColgroupContent = Colgroup { colgroupToNode :: Node }++instance Content ColgroupContent where+ toContent = colgroupToNode++colgroup' :: (Functor t, Monad t) => Attrs -> XHtmlT t ColgroupContent -> XHtmlT t TableContent+colgroup' = tellNode Table "colgroup" []++colgroup :: (Functor t, Monad t) => XHtmlT t ColgroupContent -> XHtmlT t TableContent+colgroup = tellNode Table "colgroup" [] []++newtype TrContent = Tr { trToNode :: Node }++instance Content TrContent where+ toContent = trToNode++tr' :: (Functor t, Monad t, XHtml17 c) => Attrs -> XHtmlT t TrContent -> XHtmlT t c+tr' = tellNode xhtml17 "tr" []++tr :: (Functor t, Monad t, XHtml17 c) => XHtmlT t TrContent -> XHtmlT t c+tr = tellNode xhtml17 "tr" [] []
+ src/Text/XHtmlCombinators/Frameset/Attributes.hs view
@@ -0,0 +1,126 @@+module Text.XHtmlCombinators.Frameset.Attributes where++import Data.Text (Text)+import Text.XHtmlCombinators.Internal++lang t = Attr "lang" t+xml_lang t = Attr "xml:lang" t+dir t = Attr "dir" t+id t = Attr "id" t+xmlns t = Attr "xmlns" t+profile t = Attr "profile" t+href t = Attr "href" t+target t = Attr "target" t+http_equiv t = Attr "http-equiv" t+name t = Attr "name" t+content t = Attr "content" t+scheme t = Attr "scheme" t+class_ t = Attr "class" t+style t = Attr "style" t+title t = Attr "title" t+onclick t = Attr "onclick" t+ondblclick t = Attr "ondblclick" t+onmousedown t = Attr "onmousedown" t+onmouseup t = Attr "onmouseup" t+onmouseover t = Attr "onmouseover" t+onmousemove t = Attr "onmousemove" t+onmouseout t = Attr "onmouseout" t+onkeypress t = Attr "onkeypress" t+onkeydown t = Attr "onkeydown" t+onkeyup t = Attr "onkeyup" t+charset t = Attr "charset" t+hreflang t = Attr "hreflang" t+type_ t = Attr "type" t+rel t = Attr "rel" t+rev t = Attr "rev" t+media t = Attr "media" t+xml_space t = Attr "xml:space" t+language t = Attr "language" t+src t = Attr "src" t+defer t = Attr "defer" t+rows t = Attr "rows" t+cols t = Attr "cols" t+onload t = Attr "onload" t+onunload t = Attr "onunload" t+longdesc t = Attr "longdesc" t+frameborder t = Attr "frameborder" t+marginwidth t = Attr "marginwidth" t+marginheight t = Attr "marginheight" t+noresize t = Attr "noresize" t+scrolling t = Attr "scrolling" t+align t = Attr "align" t+height t = Attr "height" t+width t = Attr "width" t+background t = Attr "background" t+bgcolor t = Attr "bgcolor" t+text t = Attr "text" t+link t = Attr "link" t+vlink t = Attr "vlink" t+alink t = Attr "alink" t+compact t = Attr "compact" t+start t = Attr "start" t+value t = Attr "value" t+noshade t = Attr "noshade" t+size t = Attr "size" t+cite t = Attr "cite" t+datetime t = Attr "datetime" t+accesskey t = Attr "accesskey" t+tabindex t = Attr "tabindex" t+onfocus t = Attr "onfocus" t+onblur t = Attr "onblur" t+shape t = Attr "shape" t+coords t = Attr "coords" t+clear t = Attr "clear" t+color t = Attr "color" t+face t = Attr "face" t+declare t = Attr "declare" t+classid t = Attr "classid" t+codebase t = Attr "codebase" t+data_ t = Attr "data" t+codetype t = Attr "codetype" t+archive t = Attr "archive" t+standby t = Attr "standby" t+usemap t = Attr "usemap" t+border t = Attr "border" t+hspace t = Attr "hspace" t+vspace t = Attr "vspace" t+valuetype t = Attr "valuetype" t+code t = Attr "code" t+object t = Attr "object" t+alt t = Attr "alt" t+ismap t = Attr "ismap" t+nohref t = Attr "nohref" t+action t = Attr "action" t+method t = Attr "method" t+enctype t = Attr "enctype" t+onsubmit t = Attr "onsubmit" t+onreset t = Attr "onreset" t+accept t = Attr "accept" t+accept_charset t = Attr "accept-charset" t+for t = Attr "for" t+checked t = Attr "checked" t+disabled t = Attr "disabled" t+readonly t = Attr "readonly" t+maxlength t = Attr "maxlength" t+onselect t = Attr "onselect" t+onchange t = Attr "onchange" t+multiple t = Attr "multiple" t+label t = Attr "label" t+selected t = Attr "selected" t+prompt t = Attr "prompt" t+summary t = Attr "summary" t+frame t = Attr "frame" t+rules t = Attr "rules" t+cellspacing t = Attr "cellspacing" t+cellpadding t = Attr "cellpadding" t+char t = Attr "char" t+charoff t = Attr "charoff" t+valign t = Attr "valign" t+span t = Attr "span" t+abbr t = Attr "abbr" t+axis t = Attr "axis" t+headers t = Attr "headers" t+scope t = Attr "scope" t+rowspan t = Attr "rowspan" t+colspan t = Attr "colspan" t+nowrap t = Attr "nowrap" t
src/Text/XHtmlCombinators/Internal.hs view
@@ -15,32 +15,71 @@ import Control.Monad.Trans.Class import Control.Monad.Trans.Writer import Data.Functor.Identity+import Data.Monoid import Data.Sequence import qualified Data.Sequence as Seq import Data.Text (Text) import qualified Data.Text as T-import GHC.Exts (IsString (..)) +-- The XHtmlMT monad transformer++newtype XHtmlMT x t a = XHtmlMT+ { unXHtmlMT :: WriterT (Seq x) t a }++instance Functor t => Functor (XHtmlMT x t) where+ fmap f (XHtmlMT w) = XHtmlMT $ fmap f w++instance (Functor t, Monad t) => Applicative (XHtmlMT x t) where+ -- Could define better instance that would+ -- just require Applicative t =>+ pure = return++ (<*>) = ap++instance Monad t => Monad (XHtmlMT x t) where+ return = XHtmlMT . return++ (XHtmlMT w) >>= f = XHtmlMT $ w >>= unXHtmlMT . f++instance MonadTrans (XHtmlMT x) where+ lift = XHtmlMT . lift++tellS :: Monad t => x -> XHtmlMT x t ()+tellS = XHtmlMT . tell . singleton++execXHtmlMT :: Monad t => XHtmlMT x t () -> t (Seq x)+execXHtmlMT = execWriterT . unXHtmlMT++-- Some handy aliases++type XHtmlT t x = XHtmlMT x t ()++type XHtml x = XHtmlT Identity x++empty :: Monad t => XHtmlT t x+empty = return ()+ type Attrs = [Attr] data Attr = Attr Text Text deriving (Show) data Node = Node Text Attrs Attrs (Seq Node) | TextNode Text- | WithAttrs Attrs deriving (Show) +class CData c where+ cdata :: Text -> c++text :: (Functor t, Monad t, CData c) => Text -> XHtmlT t c+text = tellS . cdata+ class Content e where toContent :: e -> Node -type XHtmlMT t x a = WriterT (Seq x) t a-type XHtmlT t x = XHtmlMT t x ()--type XHtml x = XHtmlT Identity x+newtype Root = Root { rootToNode :: Node } -first :: Seq a -> a-first seq | x :< _ <- viewl seq = x+instance Content Root where toContent = rootToNode textNode :: Text -> Attrs -> Attrs -> Text -> Node textNode name rattrs attrs content = @@ -48,16 +87,11 @@ emptyNode :: Text -> Attrs -> Attrs -> Node emptyNode name rattrs attrs = Node name rattrs attrs Seq.empty- -node :: (Functor t, Monad t, Content e) => Text -> Attrs -> Attrs -> XHtmlT t e -> t Node-node name rattrs attrs content = - Node name rattrs attrs . fmap toContent <$> execXHtml content -tellS :: Monad t => x -> XHtmlT t x-tellS = tell . singleton--execXHtml :: Monad t => XHtmlT t x -> t (Seq x)-execXHtml = execWriterT+node :: (Functor t, Monad t, Content e) => Text -> Attrs -> Attrs -> XHtmlT t e -> t Node+node name rattrs attrs content = do+ nodes <- fmap toContent <$> execXHtmlMT content+ return $ Node name rattrs attrs nodes tellTextNode :: Monad t => (Node -> e) -> Text -> Attrs -> Attrs -> Text -> XHtmlT t e tellTextNode c name rattrs attrs = tellS . c . textNode name rattrs attrs@@ -67,7 +101,9 @@ tellNode :: (Functor t, Monad t, Content a) => (Node -> b) -> Text -> Attrs -> Attrs -> XHtmlT t a -> XHtmlT t b-tellNode c name rattrs attrs = tellS . c <=< lift . node name rattrs attrs+tellNode c name rattrs attrs content = do+ n <- lift $ node name rattrs attrs content+ tellS (c n) -empty :: Monad t => XHtmlT t x-empty = return ()+first :: Seq a -> a+first seq | x :< _ <- viewl seq = x
src/Text/XHtmlCombinators/Render.hs view
@@ -1,3 +1,5 @@+{-# LANGUAGE OverloadedStrings #-}+ -- | -- Module : Text.XHtmlCombinators.Render -- Copyright : (c) Alasdair Armstrong 2010@@ -6,88 +8,71 @@ -- Stability : experimental -- Portability : GHC -module Text.XHtmlCombinators.Render - ( render, renderPretty- , renderT, renderPrettyT- ) where+module Text.XHtmlCombinators.Render where import Control.Applicative hiding (empty)-import Data.Foldable hiding (elem)+import Data.Foldable import Data.Functor.Identity import qualified Data.Sequence as Seq import Data.Text (Text) import qualified Data.Text as T import qualified Data.Text.IO as T-import qualified Text.XML.Light as XML+import qualified Data.Text.Encoding as T import Text.XHtmlCombinators.Internal +data Escaper e = Escaper+ { escapeAttr :: Attr -> Attr+ , escapeText :: Text -> Text+ , childEscaper :: Text -> Escaper e+ , encoder :: Text -> e+ }++unsafe :: Escaper Text+unsafe = Escaper+ { escapeAttr = id+ , escapeText = id+ , childEscaper = const unsafe+ , encoder = id+ }+ lt = T.singleton '<' gt = T.singleton '>' space = T.singleton ' ' lts = T.pack "</" nl = T.singleton '\n' -renderAttrs :: Attrs -> Text-renderAttrs [] = T.empty-renderAttrs attrs = T.concat (space : fmap renderAttr attrs)- where renderAttr (Attr name val) = - T.concat [name, T.pack "=\"", val, T.pack "\""]+renderAttrs :: Escaper e -> Attrs -> Text+renderAttrs esc [] = T.empty+renderAttrs esc attrs = + T.concat $ space : fmap (renderAttr . escapeAttr esc) attrs -renderNode (TextNode t) = t-renderNode (Node name rattrs attrs c)- | name `elem` validEmptyElements && Seq.null c = T.concat [lt, name, a, b, " />"]+renderAttr :: Attr -> Text+renderAttr (Attr key val) = T.concat [key, "=\"", val, "\""]++renderNode :: Escaper e -> Node -> Text+renderNode esc (TextNode t) = t+renderNode esc (Node name rattrs attrs c) | Seq.null c = T.concat [lt, name, a, b, gt, lts, name, gt] | otherwise = T.concat - [lt, name, a, b, gt, fold (fmap renderNode c), lts, name, gt]- where a = renderAttrs rattrs- b = renderAttrs attrs--validEmptyElements :: [Text]-validEmptyElements = [ "area"- , "base"- , "basefont"- , "br"- , "col"- , "frame"- , "hr"- , "img"- , "input"- , "isindex"- , "link"- , "meta"- , "param"- ]+ [ lt, name, a, b, gt+ , fold (renderNode (childEscaper esc name) <$> c)+ , lts, name, gt+ ]+ where + a = renderAttrs esc rattrs+ b = renderAttrs esc attrs -- | 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.-renderT :: (Functor t, Monad t, Content c) => XHtmlT t c -> t Text-renderT page = do- content <- execXHtml page- return (fold $ renderNode . toContent <$> content)---- | Renders a pretty xhtml page with readable indentation.--- --- What we do is turn the document from 'Text' into a 'String',--- parse that string with 'Text.XML.Light', then use 'Text.XML.Light''s--- pretty printing function to render it, before finally packing it again.--- It probably goes without saying, but this function is /incredibly/ inefficient!--- --- Also, 'Text.XML.Light' will render the document as proper XML, which is --- fine only if you're not trying to pass of your page as text/html.------ It also has a tendency to turn escaped characters back into their unescaped--- counterparts, so it's probably best to only use this for debugging.-renderPrettyT :: (Functor t, Monad t, Content c) => XHtmlT t c -> t Text-renderPrettyT page = do- content <- renderT page- return (T.pack . unlines . fmap XML.ppContent . XML.parseXML . T.unpack $ content)--render :: Content c => XHtml c -> Text-render = runIdentity . renderT+renderT :: (Functor t, Monad t, Content c) => Escaper e -> XHtmlT t c -> t e+renderT esc page = do+ content <- execXHtmlMT page+ let txt = fold (renderNode esc . toContent <$> content)+ return (encoder esc txt) -renderPretty :: Content c => XHtml c -> Text-renderPretty = runIdentity . renderPrettyT+render :: Content c => Escaper e -> XHtml c -> e+render esc = runIdentity . renderT esc
− src/Text/XHtmlCombinators/Safe.hs
@@ -1,123 +0,0 @@--- |--- Module : Text.XHtmlCombinators.Safe--- Copyright : (c) Alasdair Armstrong 2010--- License : BSD-style--- Maintainer : alasdair.armstrong@googlemail.com--- Stability : experimental--- Portability : GHC--module Text.XHtmlCombinators.Safe- ( module Text.XHtmlCombinators- , text- , title', title- , base', base- , meta', meta- , style', style- , script', script- , bdo', bdo- , map', map_- , area', area- , form', form- , optgroup', optgroup- , option', option- , textarea', textarea- ) where--import Data.Text (Text)-import qualified Data.Text as T--import Text.XHtmlCombinators.Escape-import qualified Text.XHtmlCombinators as X-import Text.XHtmlCombinators hiding - ( text- , title', title- , base', base- , meta', meta- , style', style- , script', script- , bdo', bdo- , img', img- , map', map_- , area', area- , form', form- , optgroup', optgroup- , option', option- , textarea', textarea- )---- TODO: Comment these explaining how escaping is applied.--text :: (Functor t, Monad t, CData c) => Text -> XHtmlT t c-text = X.text . escape--title' :: (Functor t, Monad t) => Attrs -> Text -> XHtmlT t HeadContent-title' attrs = X.title' attrs . escape--title :: (Functor t, Monad t) => Text -> XHtmlT t HeadContent-title = title' []--base' :: (Functor t, Monad t) => Text -> Attrs -> XHtmlT t HeadContent-base' = X.base' . escapeAttr --base :: (Functor t, Monad t) => Text -> XHtmlT t HeadContent-base = flip base' []--meta' :: (Functor t, Monad t) => Text -> Attrs -> XHtmlT t HeadContent-meta' = X.meta' . escapeAttr--meta :: (Functor t, Monad t) => Text -> XHtmlT t HeadContent-meta = flip meta' []--style' :: (Functor t, Monad t) => Text -> Attrs -> Text -> XHtmlT t HeadContent-style' type_ attrs css = X.style' (escapeAttr type_) attrs (escapeCSS css)--style :: (Functor t, Monad t) => Text -> Text -> XHtmlT t HeadContent-style = flip style' []--script' :: (Functor t, Monad t) => Text -> Attrs -> Text -> XHtmlT t HeadContent-script' type_ attrs js = X.script' (escapeAttr type_) attrs (escapeJavaScript js)--script :: (Functor t, Monad t) => Text -> Text -> XHtmlT t HeadContent-script = flip script' []--bdo' :: (Functor t, Monad t, Inline c) => Text -> Attrs -> XHtmlT t InlineContent -> XHtmlT t c-bdo' dir = X.bdo' (escapeAttr dir)--bdo :: (Functor t, Monad t, Inline c) => Text -> XHtmlT t InlineContent -> XHtmlT t c-bdo = flip bdo' []--map' :: (Functor t, Monad t, Flow c) => Text -> Attrs -> XHtmlT t MapContent -> XHtmlT t c-map' id = X.map' (escapeAttr id)--map_ :: (Functor t, Monad t, Flow c) => Text -> XHtmlT t MapContent -> XHtmlT t c-map_ = flip map' []--area' :: (Functor t, Monad t) => Text -> Attrs -> XHtmlT t MapContent-area' alt = X.area' (escapeAttr alt)--area :: (Functor t, Monad t) => Text -> XHtmlT t MapContent-area = flip area' []--form' :: (Functor t, Monad t, Block c) => Text -> Attrs -> XHtmlT t FlowContent -> XHtmlT t c-form' action = X.form' (escapeAttr action)--form :: (Functor t, Monad t, Block c) => Text -> XHtmlT t FlowContent -> XHtmlT t c-form = flip form' []--optgroup' :: (Functor t, Monad t) => Text -> Attrs -> XHtmlT t OptionContent -> XHtmlT t OptionContent-optgroup' label = X.optgroup' (escapeAttr label)--optgroup :: (Functor t, Monad t) => Text -> XHtmlT t OptionContent -> XHtmlT t OptionContent-optgroup = flip optgroup' []--option' :: (Functor t, Monad t) => Attrs -> Text -> XHtmlT t OptionContent-option' attrs = option' attrs . escape --option :: (Functor t, Monad t) => Text -> XHtmlT t OptionContent-option = option' []--textarea' :: (Functor t, Monad t, Inline c) => Int -> Int -> Attrs -> Text -> XHtmlT t c-textarea' rows cols attrs = X.textarea' rows cols attrs . escape--textarea :: (Functor t, Monad t, Inline c) => Int -> Int -> Text -> XHtmlT t c-textarea rows cols = textarea' rows cols []
+ src/Text/XHtmlCombinators/Strict.hs view
@@ -0,0 +1,877 @@+{-# LANGUAGE OverloadedStrings #-}+module Text.XHtmlCombinators.Strict+ ( XHtml1+ , XHtml2+ , XHtml3+ , XHtml4+ , XHtml5+ , XHtml6+ , XHtml7+ , XHtml8+ , XHtml9+ , XHtml10+ , XHtml11+ , XHtml12+ , XHtml13+ , HtmlContent+ , HeadContent+ , BlockContent+ , FlowContent+ , InlineContent+ , ListContent+ , DlContent+ , PreContent+ , AContent+ , ObjectContent+ , MapContent+ , FormContent+ , SelectContent+ , OptgroupContent+ , FieldsetContent+ , ButtonContent+ , TableContent+ , TableSectionContent+ , ColgroupContent+ , TrContent+ , html', html+ , head', head_+ , title', title+ , style', style+ , script', script+ , option', option+ , textarea', textarea+ , base', base+ , meta', meta+ , link', link+ , hr', hr+ , br', br+ , param', param+ , img', img+ , area', area+ , input', input+ , col', col+ , noscript', noscript+ , body', body+ , blockquote', blockquote+ , div', div_+ , li', li+ , dd', dd+ , ins', ins+ , del', del+ , th', th+ , td', td+ , p', p+ , h1', h1+ , h2', h2+ , h3', h3+ , h4', h4+ , h5', h5+ , h6', h6+ , dt', dt+ , address', address+ , span', span_+ , bdo', bdo+ , em', em+ , strong', strong+ , dfn', dfn+ , code', code+ , samp', samp+ , kbd', kbd+ , var', var+ , cite', cite+ , abbr', abbr+ , acronym', acronym+ , q', q+ , sub', sub+ , sup', sup+ , tt', tt+ , i', i+ , b', b+ , big', big+ , small', small+ , label', label+ , legend', legend+ , caption', caption+ , ul', ul+ , ol', ol+ , dl', dl+ , pre', pre+ , a', a+ , object', object+ , map', map_+ , form', form+ , select', select+ , optgroup', optgroup+ , fieldset', fieldset+ , button', button+ , table', table+ , thead', thead+ , tfoot', tfoot+ , tbody', tbody+ , colgroup', colgroup+ , tr', tr+ ) where++import Data.Text (Text)++import Text.XHtmlCombinators.Internal+import qualified Text.XHtmlCombinators.Strict.Attributes as A++class XHtml1 c where+ xhtml1 :: Node -> c++instance XHtml1 HeadContent where xhtml1 = Head+instance XHtml1 BlockContent where xhtml1 = Block+instance XHtml1 FlowContent where xhtml1 = Flow+instance XHtml1 InlineContent where xhtml1 = Inline+instance XHtml1 PreContent where xhtml1 = Pre+instance XHtml1 AContent where xhtml1 = A+instance XHtml1 ObjectContent where xhtml1 = Object+instance XHtml1 MapContent where xhtml1 = Map+instance XHtml1 FormContent where xhtml1 = Form+instance XHtml1 FieldsetContent where xhtml1 = Fieldset+instance XHtml1 ButtonContent where xhtml1 = Button++class XHtml2 c where+ xhtml2 :: Node -> c++instance XHtml2 SelectContent where xhtml2 = Select+instance XHtml2 OptgroupContent where xhtml2 = Optgroup++class XHtml3 c where+ xhtml3 :: Node -> c++instance XHtml3 FlowContent where xhtml3 = Flow+instance XHtml3 InlineContent where xhtml3 = Inline+instance XHtml3 PreContent where xhtml3 = Pre+instance XHtml3 AContent where xhtml3 = A+instance XHtml3 ObjectContent where xhtml3 = Object+instance XHtml3 FieldsetContent where xhtml3 = Fieldset++class XHtml4 c where+ xhtml4 :: Node -> c++instance XHtml4 BlockContent where xhtml4 = Block+instance XHtml4 FlowContent where xhtml4 = Flow+instance XHtml4 ObjectContent where xhtml4 = Object+instance XHtml4 MapContent where xhtml4 = Map+instance XHtml4 FormContent where xhtml4 = Form+instance XHtml4 FieldsetContent where xhtml4 = Fieldset+instance XHtml4 ButtonContent where xhtml4 = Button++class XHtml5 c where+ xhtml5 :: Node -> c++instance XHtml5 FlowContent where xhtml5 = Flow+instance XHtml5 InlineContent where xhtml5 = Inline+instance XHtml5 PreContent where xhtml5 = Pre+instance XHtml5 AContent where xhtml5 = A+instance XHtml5 ObjectContent where xhtml5 = Object+instance XHtml5 FieldsetContent where xhtml5 = Fieldset+instance XHtml5 ButtonContent where xhtml5 = Button++class XHtml6 c where+ xhtml6 :: Node -> c++instance XHtml6 FlowContent where xhtml6 = Flow+instance XHtml6 InlineContent where xhtml6 = Inline+instance XHtml6 AContent where xhtml6 = A+instance XHtml6 ObjectContent where xhtml6 = Object+instance XHtml6 FieldsetContent where xhtml6 = Fieldset+instance XHtml6 ButtonContent where xhtml6 = Button++class XHtml7 c where+ xhtml7 :: Node -> c++instance XHtml7 TableContent where xhtml7 = Table+instance XHtml7 ColgroupContent where xhtml7 = Colgroup++class XHtml8 c where+ xhtml8 :: Node -> c++instance XHtml8 BlockContent where xhtml8 = Block+instance XHtml8 FlowContent where xhtml8 = Flow+instance XHtml8 InlineContent where xhtml8 = Inline+instance XHtml8 PreContent where xhtml8 = Pre+instance XHtml8 AContent where xhtml8 = A+instance XHtml8 ObjectContent where xhtml8 = Object+instance XHtml8 MapContent where xhtml8 = Map+instance XHtml8 FormContent where xhtml8 = Form+instance XHtml8 FieldsetContent where xhtml8 = Fieldset+instance XHtml8 ButtonContent where xhtml8 = Button++class XHtml9 c where+ xhtml9 :: Node -> c++instance XHtml9 FlowContent where xhtml9 = Flow+instance XHtml9 InlineContent where xhtml9 = Inline+instance XHtml9 PreContent where xhtml9 = Pre+instance XHtml9 ObjectContent where xhtml9 = Object+instance XHtml9 FieldsetContent where xhtml9 = Fieldset++class XHtml10 c where+ xhtml10 :: Node -> c++instance XHtml10 HeadContent where xhtml10 = Head+instance XHtml10 FlowContent where xhtml10 = Flow+instance XHtml10 InlineContent where xhtml10 = Inline+instance XHtml10 AContent where xhtml10 = A+instance XHtml10 ObjectContent where xhtml10 = Object+instance XHtml10 FieldsetContent where xhtml10 = Fieldset+instance XHtml10 ButtonContent where xhtml10 = Button++class XHtml11 c where+ xhtml11 :: Node -> c++instance XHtml11 BlockContent where xhtml11 = Block+instance XHtml11 FlowContent where xhtml11 = Flow+instance XHtml11 ObjectContent where xhtml11 = Object+instance XHtml11 MapContent where xhtml11 = Map+instance XHtml11 FieldsetContent where xhtml11 = Fieldset++class XHtml12 c where+ xhtml12 :: Node -> c++instance XHtml12 BlockContent where xhtml12 = Block+instance XHtml12 FlowContent where xhtml12 = Flow+instance XHtml12 ObjectContent where xhtml12 = Object+instance XHtml12 MapContent where xhtml12 = Map+instance XHtml12 FormContent where xhtml12 = Form+instance XHtml12 FieldsetContent where xhtml12 = Fieldset++class XHtml13 c where+ xhtml13 :: Node -> c++instance XHtml13 TableContent where xhtml13 = Table+instance XHtml13 TableSectionContent where xhtml13 = TableSection++newtype HtmlContent = Html { htmlToNode :: Node }++instance Content HtmlContent where+ toContent = htmlToNode++html' :: (Functor t, Monad t) => Attrs -> XHtmlT t HtmlContent -> XHtmlT t Root+html' = tellNode Root "html" []++html :: (Functor t, Monad t) => XHtmlT t HtmlContent -> XHtmlT t Root+html = tellNode Root "html" [] []++newtype HeadContent = Head { headToNode :: Node }++instance Content HeadContent where+ toContent = headToNode++head' :: (Functor t, Monad t) => Attrs -> XHtmlT t HeadContent -> XHtmlT t HtmlContent+head' = tellNode Html "head" []++head_ :: (Functor t, Monad t) => XHtmlT t HeadContent -> XHtmlT t HtmlContent+head_ = tellNode Html "head" [] []++title' :: (Functor t, Monad t) => Attrs -> Text -> XHtmlT t HeadContent+title' = tellTextNode Head "title" []++title :: (Functor t, Monad t) => Text -> XHtmlT t HeadContent+title = tellTextNode Head "title" [] []++style' :: (Functor t, Monad t)+ => Text -- ^ Required type attribute.+ -> Attrs -> Text -> XHtmlT t HeadContent+style' a = tellTextNode Head "style" [A.type_ a]++style :: (Functor t, Monad t)+ => Text -- ^ Required type attribute.+ -> Text -> XHtmlT t HeadContent+style a = tellTextNode Head "style" [A.type_ a] []++script' :: (Functor t, Monad t, XHtml1 c)+ => Text -- ^ Required type attribute.+ -> Attrs -> Text -> XHtmlT t c+script' a = tellTextNode xhtml1 "script" [A.type_ a]++script :: (Functor t, Monad t, XHtml1 c)+ => Text -- ^ Required type attribute.+ -> Text -> XHtmlT t c+script a = tellTextNode xhtml1 "script" [A.type_ a] []++option' :: (Functor t, Monad t, XHtml2 c) => Attrs -> Text -> XHtmlT t c+option' = tellTextNode xhtml2 "option" []++option :: (Functor t, Monad t, XHtml2 c) => Text -> XHtmlT t c+option = tellTextNode xhtml2 "option" [] []++textarea' :: (Functor t, Monad t, XHtml3 c)+ => Text -- ^ Required rows attribute.+ -> Text -- ^ Required cols attribute.+ -> Attrs -> Text -> XHtmlT t c+textarea' a b = tellTextNode xhtml3 "textarea" [A.rows a, A.cols b]++textarea :: (Functor t, Monad t, XHtml3 c)+ => Text -- ^ Required rows attribute.+ -> Text -- ^ Required cols attribute.+ -> Text -> XHtmlT t c+textarea a b = tellTextNode xhtml3 "textarea" [A.rows a, A.cols b] []++base' :: (Functor t, Monad t)+ => Text -- ^ Required href attribute.+ -> Attrs -> XHtmlT t HeadContent+base' a = tellEmptyNode Head "base" [A.href a]++base :: (Functor t, Monad t)+ => Text -- ^ Required href attribute.+ -> XHtmlT t HeadContent+base a = tellEmptyNode Head "base" [A.href a] []++meta' :: (Functor t, Monad t)+ => Text -- ^ Required content attribute.+ -> Attrs -> XHtmlT t HeadContent+meta' a = tellEmptyNode Head "meta" [A.content a]++meta :: (Functor t, Monad t)+ => Text -- ^ Required content attribute.+ -> XHtmlT t HeadContent+meta a = tellEmptyNode Head "meta" [A.content a] []++link' :: (Functor t, Monad t) => Attrs -> XHtmlT t HeadContent+link' = tellEmptyNode Head "link" []++link :: (Functor t, Monad t) => XHtmlT t HeadContent+link = tellEmptyNode Head "link" [] []++hr' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t c+hr' = tellEmptyNode xhtml4 "hr" []++hr :: (Functor t, Monad t, XHtml4 c) => XHtmlT t c+hr = tellEmptyNode xhtml4 "hr" [] []++br' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t c+br' = tellEmptyNode xhtml5 "br" []++br :: (Functor t, Monad t, XHtml5 c) => XHtmlT t c+br = tellEmptyNode xhtml5 "br" [] []++param' :: (Functor t, Monad t) => Attrs -> XHtmlT t ObjectContent+param' = tellEmptyNode Object "param" []++param :: (Functor t, Monad t) => XHtmlT t ObjectContent+param = tellEmptyNode Object "param" [] []++img' :: (Functor t, Monad t, XHtml6 c)+ => Text -- ^ Required src attribute.+ -> Text -- ^ Required alt attribute.+ -> Attrs -> XHtmlT t c+img' a b = tellEmptyNode xhtml6 "img" [A.src a, A.alt b]++img :: (Functor t, Monad t, XHtml6 c)+ => Text -- ^ Required src attribute.+ -> Text -- ^ Required alt attribute.+ -> XHtmlT t c+img a b = tellEmptyNode xhtml6 "img" [A.src a, A.alt b] []++area' :: (Functor t, Monad t)+ => Text -- ^ Required alt attribute.+ -> Attrs -> XHtmlT t MapContent+area' a = tellEmptyNode Map "area" [A.alt a]++area :: (Functor t, Monad t)+ => Text -- ^ Required alt attribute.+ -> XHtmlT t MapContent+area a = tellEmptyNode Map "area" [A.alt a] []++input' :: (Functor t, Monad t, XHtml3 c) => Attrs -> XHtmlT t c+input' = tellEmptyNode xhtml3 "input" []++input :: (Functor t, Monad t, XHtml3 c) => XHtmlT t c+input = tellEmptyNode xhtml3 "input" [] []++col' :: (Functor t, Monad t, XHtml7 c) => Attrs -> XHtmlT t c+col' = tellEmptyNode xhtml7 "col" []++col :: (Functor t, Monad t, XHtml7 c) => XHtmlT t c+col = tellEmptyNode xhtml7 "col" [] []++newtype BlockContent = Block { blockToNode :: Node }++instance Content BlockContent where+ toContent = blockToNode++noscript' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t BlockContent -> XHtmlT t c+noscript' = tellNode xhtml4 "noscript" []++noscript :: (Functor t, Monad t, XHtml4 c) => XHtmlT t BlockContent -> XHtmlT t c+noscript = tellNode xhtml4 "noscript" [] []++body' :: (Functor t, Monad t) => Attrs -> XHtmlT t BlockContent -> XHtmlT t HtmlContent+body' = tellNode Html "body" []++body :: (Functor t, Monad t) => XHtmlT t BlockContent -> XHtmlT t HtmlContent+body = tellNode Html "body" [] []++blockquote' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t BlockContent -> XHtmlT t c+blockquote' = tellNode xhtml4 "blockquote" []++blockquote :: (Functor t, Monad t, XHtml4 c) => XHtmlT t BlockContent -> XHtmlT t c+blockquote = tellNode xhtml4 "blockquote" [] []++newtype FlowContent = Flow { flowToNode :: Node }++instance Content FlowContent where+ toContent = flowToNode++instance CData FlowContent where+ cdata = Flow . TextNode++div' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t FlowContent -> XHtmlT t c+div' = tellNode xhtml4 "div" []++div_ :: (Functor t, Monad t, XHtml4 c) => XHtmlT t FlowContent -> XHtmlT t c+div_ = tellNode xhtml4 "div" [] []++li' :: (Functor t, Monad t) => Attrs -> XHtmlT t FlowContent -> XHtmlT t ListContent+li' = tellNode List "li" []++li :: (Functor t, Monad t) => XHtmlT t FlowContent -> XHtmlT t ListContent+li = tellNode List "li" [] []++dd' :: (Functor t, Monad t) => Attrs -> XHtmlT t FlowContent -> XHtmlT t DlContent+dd' = tellNode Dl "dd" []++dd :: (Functor t, Monad t) => XHtmlT t FlowContent -> XHtmlT t DlContent+dd = tellNode Dl "dd" [] []++ins' :: (Functor t, Monad t, XHtml8 c) => Attrs -> XHtmlT t FlowContent -> XHtmlT t c+ins' = tellNode xhtml8 "ins" []++ins :: (Functor t, Monad t, XHtml8 c) => XHtmlT t FlowContent -> XHtmlT t c+ins = tellNode xhtml8 "ins" [] []++del' :: (Functor t, Monad t, XHtml8 c) => Attrs -> XHtmlT t FlowContent -> XHtmlT t c+del' = tellNode xhtml8 "del" []++del :: (Functor t, Monad t, XHtml8 c) => XHtmlT t FlowContent -> XHtmlT t c+del = tellNode xhtml8 "del" [] []++th' :: (Functor t, Monad t) => Attrs -> XHtmlT t FlowContent -> XHtmlT t TrContent+th' = tellNode Tr "th" []++th :: (Functor t, Monad t) => XHtmlT t FlowContent -> XHtmlT t TrContent+th = tellNode Tr "th" [] []++td' :: (Functor t, Monad t) => Attrs -> XHtmlT t FlowContent -> XHtmlT t TrContent+td' = tellNode Tr "td" []++td :: (Functor t, Monad t) => XHtmlT t FlowContent -> XHtmlT t TrContent+td = tellNode Tr "td" [] []++newtype InlineContent = Inline { inlineToNode :: Node }++instance Content InlineContent where+ toContent = inlineToNode++instance CData InlineContent where+ cdata = Inline . TextNode++p' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+p' = tellNode xhtml4 "p" []++p :: (Functor t, Monad t, XHtml4 c) => XHtmlT t InlineContent -> XHtmlT t c+p = tellNode xhtml4 "p" [] []++h1' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+h1' = tellNode xhtml4 "h1" []++h1 :: (Functor t, Monad t, XHtml4 c) => XHtmlT t InlineContent -> XHtmlT t c+h1 = tellNode xhtml4 "h1" [] []++h2' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+h2' = tellNode xhtml4 "h2" []++h2 :: (Functor t, Monad t, XHtml4 c) => XHtmlT t InlineContent -> XHtmlT t c+h2 = tellNode xhtml4 "h2" [] []++h3' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+h3' = tellNode xhtml4 "h3" []++h3 :: (Functor t, Monad t, XHtml4 c) => XHtmlT t InlineContent -> XHtmlT t c+h3 = tellNode xhtml4 "h3" [] []++h4' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+h4' = tellNode xhtml4 "h4" []++h4 :: (Functor t, Monad t, XHtml4 c) => XHtmlT t InlineContent -> XHtmlT t c+h4 = tellNode xhtml4 "h4" [] []++h5' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+h5' = tellNode xhtml4 "h5" []++h5 :: (Functor t, Monad t, XHtml4 c) => XHtmlT t InlineContent -> XHtmlT t c+h5 = tellNode xhtml4 "h5" [] []++h6' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+h6' = tellNode xhtml4 "h6" []++h6 :: (Functor t, Monad t, XHtml4 c) => XHtmlT t InlineContent -> XHtmlT t c+h6 = tellNode xhtml4 "h6" [] []++dt' :: (Functor t, Monad t) => Attrs -> XHtmlT t InlineContent -> XHtmlT t DlContent+dt' = tellNode Dl "dt" []++dt :: (Functor t, Monad t) => XHtmlT t InlineContent -> XHtmlT t DlContent+dt = tellNode Dl "dt" [] []++address' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+address' = tellNode xhtml4 "address" []++address :: (Functor t, Monad t, XHtml4 c) => XHtmlT t InlineContent -> XHtmlT t c+address = tellNode xhtml4 "address" [] []++span' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+span' = tellNode xhtml5 "span" []++span_ :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+span_ = tellNode xhtml5 "span" [] []++bdo' :: (Functor t, Monad t, XHtml5 c)+ => Text -- ^ Required dir attribute.+ -> Attrs -> XHtmlT t InlineContent -> XHtmlT t c+bdo' a = tellNode xhtml5 "bdo" [A.dir a]++bdo :: (Functor t, Monad t, XHtml5 c)+ => Text -- ^ Required dir attribute.+ -> XHtmlT t InlineContent -> XHtmlT t c+bdo a = tellNode xhtml5 "bdo" [A.dir a] []++em' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+em' = tellNode xhtml5 "em" []++em :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+em = tellNode xhtml5 "em" [] []++strong' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+strong' = tellNode xhtml5 "strong" []++strong :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+strong = tellNode xhtml5 "strong" [] []++dfn' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+dfn' = tellNode xhtml5 "dfn" []++dfn :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+dfn = tellNode xhtml5 "dfn" [] []++code' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+code' = tellNode xhtml5 "code" []++code :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+code = tellNode xhtml5 "code" [] []++samp' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+samp' = tellNode xhtml5 "samp" []++samp :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+samp = tellNode xhtml5 "samp" [] []++kbd' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+kbd' = tellNode xhtml5 "kbd" []++kbd :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+kbd = tellNode xhtml5 "kbd" [] []++var' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+var' = tellNode xhtml5 "var" []++var :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+var = tellNode xhtml5 "var" [] []++cite' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+cite' = tellNode xhtml5 "cite" []++cite :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+cite = tellNode xhtml5 "cite" [] []++abbr' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+abbr' = tellNode xhtml5 "abbr" []++abbr :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+abbr = tellNode xhtml5 "abbr" [] []++acronym' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+acronym' = tellNode xhtml5 "acronym" []++acronym :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+acronym = tellNode xhtml5 "acronym" [] []++q' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+q' = tellNode xhtml5 "q" []++q :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+q = tellNode xhtml5 "q" [] []++sub' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+sub' = tellNode xhtml5 "sub" []++sub :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+sub = tellNode xhtml5 "sub" [] []++sup' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+sup' = tellNode xhtml5 "sup" []++sup :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+sup = tellNode xhtml5 "sup" [] []++tt' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+tt' = tellNode xhtml5 "tt" []++tt :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+tt = tellNode xhtml5 "tt" [] []++i' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+i' = tellNode xhtml5 "i" []++i :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+i = tellNode xhtml5 "i" [] []++b' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+b' = tellNode xhtml5 "b" []++b :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+b = tellNode xhtml5 "b" [] []++big' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+big' = tellNode xhtml5 "big" []++big :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+big = tellNode xhtml5 "big" [] []++small' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+small' = tellNode xhtml5 "small" []++small :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+small = tellNode xhtml5 "small" [] []++label' :: (Functor t, Monad t, XHtml3 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+label' = tellNode xhtml3 "label" []++label :: (Functor t, Monad t, XHtml3 c) => XHtmlT t InlineContent -> XHtmlT t c+label = tellNode xhtml3 "label" [] []++legend' :: (Functor t, Monad t) => Attrs -> XHtmlT t InlineContent -> XHtmlT t FieldsetContent+legend' = tellNode Fieldset "legend" []++legend :: (Functor t, Monad t) => XHtmlT t InlineContent -> XHtmlT t FieldsetContent+legend = tellNode Fieldset "legend" [] []++caption' :: (Functor t, Monad t) => Attrs -> XHtmlT t InlineContent -> XHtmlT t TableContent+caption' = tellNode Table "caption" []++caption :: (Functor t, Monad t) => XHtmlT t InlineContent -> XHtmlT t TableContent+caption = tellNode Table "caption" [] []++newtype ListContent = List { listToNode :: Node }++instance Content ListContent where+ toContent = listToNode++ul' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t ListContent -> XHtmlT t c+ul' = tellNode xhtml4 "ul" []++ul :: (Functor t, Monad t, XHtml4 c) => XHtmlT t ListContent -> XHtmlT t c+ul = tellNode xhtml4 "ul" [] []++ol' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t ListContent -> XHtmlT t c+ol' = tellNode xhtml4 "ol" []++ol :: (Functor t, Monad t, XHtml4 c) => XHtmlT t ListContent -> XHtmlT t c+ol = tellNode xhtml4 "ol" [] []++newtype DlContent = Dl { dlToNode :: Node }++instance Content DlContent where+ toContent = dlToNode++dl' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t DlContent -> XHtmlT t c+dl' = tellNode xhtml4 "dl" []++dl :: (Functor t, Monad t, XHtml4 c) => XHtmlT t DlContent -> XHtmlT t c+dl = tellNode xhtml4 "dl" [] []++newtype PreContent = Pre { preToNode :: Node }++instance Content PreContent where+ toContent = preToNode++instance CData PreContent where+ cdata = Pre . TextNode++pre' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t PreContent -> XHtmlT t c+pre' = tellNode xhtml4 "pre" []++pre :: (Functor t, Monad t, XHtml4 c) => XHtmlT t PreContent -> XHtmlT t c+pre = tellNode xhtml4 "pre" [] []++newtype AContent = A { aToNode :: Node }++instance Content AContent where+ toContent = aToNode++instance CData AContent where+ cdata = A . TextNode++a' :: (Functor t, Monad t, XHtml9 c) => Attrs -> XHtmlT t AContent -> XHtmlT t c+a' = tellNode xhtml9 "a" []++a :: (Functor t, Monad t, XHtml9 c) => XHtmlT t AContent -> XHtmlT t c+a = tellNode xhtml9 "a" [] []++newtype ObjectContent = Object { objectToNode :: Node }++instance Content ObjectContent where+ toContent = objectToNode++instance CData ObjectContent where+ cdata = Object . TextNode++object' :: (Functor t, Monad t, XHtml10 c) => Attrs -> XHtmlT t ObjectContent -> XHtmlT t c+object' = tellNode xhtml10 "object" []++object :: (Functor t, Monad t, XHtml10 c) => XHtmlT t ObjectContent -> XHtmlT t c+object = tellNode xhtml10 "object" [] []++newtype MapContent = Map { mapToNode :: Node }++instance Content MapContent where+ toContent = mapToNode++map' :: (Functor t, Monad t, XHtml5 c)+ => Text -- ^ Required id attribute.+ -> Attrs -> XHtmlT t MapContent -> XHtmlT t c+map' a = tellNode xhtml5 "map" [A.id a]++map_ :: (Functor t, Monad t, XHtml5 c)+ => Text -- ^ Required id attribute.+ -> XHtmlT t MapContent -> XHtmlT t c+map_ a = tellNode xhtml5 "map" [A.id a] []++newtype FormContent = Form { formToNode :: Node }++instance Content FormContent where+ toContent = formToNode++form' :: (Functor t, Monad t, XHtml11 c)+ => Text -- ^ Required action attribute.+ -> Attrs -> XHtmlT t FormContent -> XHtmlT t c+form' a = tellNode xhtml11 "form" [A.action a]++form :: (Functor t, Monad t, XHtml11 c)+ => Text -- ^ Required action attribute.+ -> XHtmlT t FormContent -> XHtmlT t c+form a = tellNode xhtml11 "form" [A.action a] []++newtype SelectContent = Select { selectToNode :: Node }++instance Content SelectContent where+ toContent = selectToNode++select' :: (Functor t, Monad t, XHtml3 c) => Attrs -> XHtmlT t SelectContent -> XHtmlT t c+select' = tellNode xhtml3 "select" []++select :: (Functor t, Monad t, XHtml3 c) => XHtmlT t SelectContent -> XHtmlT t c+select = tellNode xhtml3 "select" [] []++newtype OptgroupContent = Optgroup { optgroupToNode :: Node }++instance Content OptgroupContent where+ toContent = optgroupToNode++optgroup' :: (Functor t, Monad t)+ => Text -- ^ Required label attribute.+ -> Attrs -> XHtmlT t OptgroupContent -> XHtmlT t SelectContent+optgroup' a = tellNode Select "optgroup" [A.label a]++optgroup :: (Functor t, Monad t)+ => Text -- ^ Required label attribute.+ -> XHtmlT t OptgroupContent -> XHtmlT t SelectContent+optgroup a = tellNode Select "optgroup" [A.label a] []++newtype FieldsetContent = Fieldset { fieldsetToNode :: Node }++instance Content FieldsetContent where+ toContent = fieldsetToNode++instance CData FieldsetContent where+ cdata = Fieldset . TextNode++fieldset' :: (Functor t, Monad t, XHtml12 c) => Attrs -> XHtmlT t FieldsetContent -> XHtmlT t c+fieldset' = tellNode xhtml12 "fieldset" []++fieldset :: (Functor t, Monad t, XHtml12 c) => XHtmlT t FieldsetContent -> XHtmlT t c+fieldset = tellNode xhtml12 "fieldset" [] []++newtype ButtonContent = Button { buttonToNode :: Node }++instance Content ButtonContent where+ toContent = buttonToNode++instance CData ButtonContent where+ cdata = Button . TextNode++button' :: (Functor t, Monad t, XHtml3 c) => Attrs -> XHtmlT t ButtonContent -> XHtmlT t c+button' = tellNode xhtml3 "button" []++button :: (Functor t, Monad t, XHtml3 c) => XHtmlT t ButtonContent -> XHtmlT t c+button = tellNode xhtml3 "button" [] []++newtype TableContent = Table { tableToNode :: Node }++instance Content TableContent where+ toContent = tableToNode++table' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t TableContent -> XHtmlT t c+table' = tellNode xhtml4 "table" []++table :: (Functor t, Monad t, XHtml4 c) => XHtmlT t TableContent -> XHtmlT t c+table = tellNode xhtml4 "table" [] []++newtype TableSectionContent = TableSection { tablesectionToNode :: Node }++instance Content TableSectionContent where+ toContent = tablesectionToNode++thead' :: (Functor t, Monad t) => Attrs -> XHtmlT t TableSectionContent -> XHtmlT t TableContent+thead' = tellNode Table "thead" []++thead :: (Functor t, Monad t) => XHtmlT t TableSectionContent -> XHtmlT t TableContent+thead = tellNode Table "thead" [] []++tfoot' :: (Functor t, Monad t) => Attrs -> XHtmlT t TableSectionContent -> XHtmlT t TableContent+tfoot' = tellNode Table "tfoot" []++tfoot :: (Functor t, Monad t) => XHtmlT t TableSectionContent -> XHtmlT t TableContent+tfoot = tellNode Table "tfoot" [] []++tbody' :: (Functor t, Monad t) => Attrs -> XHtmlT t TableSectionContent -> XHtmlT t TableContent+tbody' = tellNode Table "tbody" []++tbody :: (Functor t, Monad t) => XHtmlT t TableSectionContent -> XHtmlT t TableContent+tbody = tellNode Table "tbody" [] []++newtype ColgroupContent = Colgroup { colgroupToNode :: Node }++instance Content ColgroupContent where+ toContent = colgroupToNode++colgroup' :: (Functor t, Monad t) => Attrs -> XHtmlT t ColgroupContent -> XHtmlT t TableContent+colgroup' = tellNode Table "colgroup" []++colgroup :: (Functor t, Monad t) => XHtmlT t ColgroupContent -> XHtmlT t TableContent+colgroup = tellNode Table "colgroup" [] []++newtype TrContent = Tr { trToNode :: Node }++instance Content TrContent where+ toContent = trToNode++tr' :: (Functor t, Monad t, XHtml13 c) => Attrs -> XHtmlT t TrContent -> XHtmlT t c+tr' = tellNode xhtml13 "tr" []++tr :: (Functor t, Monad t, XHtml13 c) => XHtmlT t TrContent -> XHtmlT t c+tr = tellNode xhtml13 "tr" [] []
+ src/Text/XHtmlCombinators/Strict/Attributes.hs view
@@ -0,0 +1,101 @@+module Text.XHtmlCombinators.Strict.Attributes where++import Data.Text (Text)+import Text.XHtmlCombinators.Internal++lang t = Attr "lang" t+xml_lang t = Attr "xml:lang" t+dir t = Attr "dir" t+id t = Attr "id" t+xmlns t = Attr "xmlns" t+profile t = Attr "profile" t+href t = Attr "href" t+http_equiv t = Attr "http-equiv" t+name t = Attr "name" t+content t = Attr "content" t+scheme t = Attr "scheme" t+class_ t = Attr "class" t+style t = Attr "style" t+title t = Attr "title" t+onclick t = Attr "onclick" t+ondblclick t = Attr "ondblclick" t+onmousedown t = Attr "onmousedown" t+onmouseup t = Attr "onmouseup" t+onmouseover t = Attr "onmouseover" t+onmousemove t = Attr "onmousemove" t+onmouseout t = Attr "onmouseout" t+onkeypress t = Attr "onkeypress" t+onkeydown t = Attr "onkeydown" t+onkeyup t = Attr "onkeyup" t+charset t = Attr "charset" t+hreflang t = Attr "hreflang" t+type_ t = Attr "type" t+rel t = Attr "rel" t+rev t = Attr "rev" t+media t = Attr "media" t+xml_space t = Attr "xml:space" t+src t = Attr "src" t+defer t = Attr "defer" t+onload t = Attr "onload" t+onunload t = Attr "onunload" t+cite t = Attr "cite" t+datetime t = Attr "datetime" t+accesskey t = Attr "accesskey" t+tabindex t = Attr "tabindex" t+onfocus t = Attr "onfocus" t+onblur t = Attr "onblur" t+shape t = Attr "shape" t+coords t = Attr "coords" t+declare t = Attr "declare" t+classid t = Attr "classid" t+codebase t = Attr "codebase" t+data_ t = Attr "data" t+codetype t = Attr "codetype" t+archive t = Attr "archive" t+standby t = Attr "standby" t+height t = Attr "height" t+width t = Attr "width" t+usemap t = Attr "usemap" t+value t = Attr "value" t+valuetype t = Attr "valuetype" t+alt t = Attr "alt" t+longdesc t = Attr "longdesc" t+ismap t = Attr "ismap" t+nohref t = Attr "nohref" t+action t = Attr "action" t+method t = Attr "method" t+enctype t = Attr "enctype" t+onsubmit t = Attr "onsubmit" t+onreset t = Attr "onreset" t+accept t = Attr "accept" t+accept_charset t = Attr "accept-charset" t+for t = Attr "for" t+checked t = Attr "checked" t+disabled t = Attr "disabled" t+readonly t = Attr "readonly" t+size t = Attr "size" t+maxlength t = Attr "maxlength" t+onselect t = Attr "onselect" t+onchange t = Attr "onchange" t+multiple t = Attr "multiple" t+label t = Attr "label" t+selected t = Attr "selected" t+rows t = Attr "rows" t+cols t = Attr "cols" t+summary t = Attr "summary" t+border t = Attr "border" t+frame t = Attr "frame" t+rules t = Attr "rules" t+cellspacing t = Attr "cellspacing" t+cellpadding t = Attr "cellpadding" t+align t = Attr "align" t+char t = Attr "char" t+charoff t = Attr "charoff" t+valign t = Attr "valign" t+span t = Attr "span" t+abbr t = Attr "abbr" t+axis t = Attr "axis" t+headers t = Attr "headers" t+scope t = Attr "scope" t+rowspan t = Attr "rowspan" t+colspan t = Attr "colspan" t
+ src/Text/XHtmlCombinators/Transitional.hs view
@@ -0,0 +1,1019 @@+{-# LANGUAGE OverloadedStrings #-}+module Text.XHtmlCombinators.Transitional+ ( XHtml1+ , XHtml2+ , XHtml3+ , XHtml4+ , XHtml5+ , XHtml6+ , XHtml7+ , XHtml8+ , XHtml9+ , XHtml10+ , XHtml11+ , XHtml12+ , XHtml13+ , XHtml14+ , XHtml15+ , XHtml16+ , HtmlContent+ , HeadContent+ , BlockContent+ , InlineContent+ , ListContent+ , DlContent+ , AddressContent+ , PreContent+ , AContent+ , ObjectContent+ , MapContent+ , FormContent+ , SelectContent+ , OptgroupContent+ , FieldsetContent+ , ButtonContent+ , TableContent+ , TableSectionContent+ , ColgroupContent+ , TrContent+ , html', html+ , head', head_+ , title', title+ , style', style+ , script', script+ , option', option+ , textarea', textarea+ , base', base+ , meta', meta+ , link', link+ , hr', hr+ , br', br+ , basefont', basefont+ , param', param+ , img', img+ , area', area+ , input', input+ , isindex', isindex+ , col', col+ , noscript', noscript+ , iframe', iframe+ , noframes', noframes+ , body', body+ , div', div_+ , li', li+ , dd', dd+ , blockquote', blockquote+ , center', center+ , ins', ins+ , del', del+ , th', th+ , td', td+ , p', p+ , h1', h1+ , h2', h2+ , h3', h3+ , h4', h4+ , h5', h5+ , h6', h6+ , dt', dt+ , span', span_+ , bdo', bdo+ , em', em+ , strong', strong+ , dfn', dfn+ , code', code+ , samp', samp+ , kbd', kbd+ , var', var+ , cite', cite+ , abbr', abbr+ , acronym', acronym+ , q', q+ , sub', sub+ , sup', sup+ , tt', tt+ , i', i+ , b', b+ , big', big+ , small', small+ , u', u+ , s', s+ , strike', strike+ , font', font+ , label', label+ , legend', legend+ , caption', caption+ , ul', ul+ , ol', ol+ , menu', menu+ , dir', dir+ , dl', dl+ , address', address+ , pre', pre+ , a', a+ , object', object+ , applet', applet+ , map', map_+ , form', form+ , select', select+ , optgroup', optgroup+ , fieldset', fieldset+ , button', button+ , table', table+ , thead', thead+ , tfoot', tfoot+ , tbody', tbody+ , colgroup', colgroup+ , tr', tr+ ) where++import Data.Text (Text)++import Text.XHtmlCombinators.Internal+import qualified Text.XHtmlCombinators.Transitional.Attributes as A++class XHtml1 c where+ xhtml1 :: Node -> c++instance XHtml1 HeadContent where xhtml1 = Head+instance XHtml1 BlockContent where xhtml1 = Block+instance XHtml1 InlineContent where xhtml1 = Inline+instance XHtml1 AddressContent where xhtml1 = Address+instance XHtml1 PreContent where xhtml1 = Pre+instance XHtml1 AContent where xhtml1 = A+instance XHtml1 ObjectContent where xhtml1 = Object+instance XHtml1 MapContent where xhtml1 = Map+instance XHtml1 FormContent where xhtml1 = Form+instance XHtml1 FieldsetContent where xhtml1 = Fieldset+instance XHtml1 ButtonContent where xhtml1 = Button++class XHtml2 c where+ xhtml2 :: Node -> c++instance XHtml2 SelectContent where xhtml2 = Select+instance XHtml2 OptgroupContent where xhtml2 = Optgroup++class XHtml3 c where+ xhtml3 :: Node -> c++instance XHtml3 BlockContent where xhtml3 = Block+instance XHtml3 InlineContent where xhtml3 = Inline+instance XHtml3 AddressContent where xhtml3 = Address+instance XHtml3 PreContent where xhtml3 = Pre+instance XHtml3 AContent where xhtml3 = A+instance XHtml3 ObjectContent where xhtml3 = Object+instance XHtml3 FormContent where xhtml3 = Form+instance XHtml3 FieldsetContent where xhtml3 = Fieldset++class XHtml4 c where+ xhtml4 :: Node -> c++instance XHtml4 BlockContent where xhtml4 = Block+instance XHtml4 ObjectContent where xhtml4 = Object+instance XHtml4 MapContent where xhtml4 = Map+instance XHtml4 FormContent where xhtml4 = Form+instance XHtml4 FieldsetContent where xhtml4 = Fieldset+instance XHtml4 ButtonContent where xhtml4 = Button++class XHtml5 c where+ xhtml5 :: Node -> c++instance XHtml5 BlockContent where xhtml5 = Block+instance XHtml5 InlineContent where xhtml5 = Inline+instance XHtml5 AddressContent where xhtml5 = Address+instance XHtml5 PreContent where xhtml5 = Pre+instance XHtml5 AContent where xhtml5 = A+instance XHtml5 ObjectContent where xhtml5 = Object+instance XHtml5 FormContent where xhtml5 = Form+instance XHtml5 FieldsetContent where xhtml5 = Fieldset+instance XHtml5 ButtonContent where xhtml5 = Button++class XHtml6 c where+ xhtml6 :: Node -> c++instance XHtml6 BlockContent where xhtml6 = Block+instance XHtml6 InlineContent where xhtml6 = Inline+instance XHtml6 AddressContent where xhtml6 = Address+instance XHtml6 AContent where xhtml6 = A+instance XHtml6 ObjectContent where xhtml6 = Object+instance XHtml6 FormContent where xhtml6 = Form+instance XHtml6 FieldsetContent where xhtml6 = Fieldset+instance XHtml6 ButtonContent where xhtml6 = Button++class XHtml7 c where+ xhtml7 :: Node -> c++instance XHtml7 HeadContent where xhtml7 = Head+instance XHtml7 BlockContent where xhtml7 = Block+instance XHtml7 ObjectContent where xhtml7 = Object+instance XHtml7 MapContent where xhtml7 = Map+instance XHtml7 FormContent where xhtml7 = Form+instance XHtml7 FieldsetContent where xhtml7 = Fieldset++class XHtml8 c where+ xhtml8 :: Node -> c++instance XHtml8 TableContent where xhtml8 = Table+instance XHtml8 ColgroupContent where xhtml8 = Colgroup++class XHtml9 c where+ xhtml9 :: Node -> c++instance XHtml9 BlockContent where xhtml9 = Block+instance XHtml9 InlineContent where xhtml9 = Inline+instance XHtml9 AddressContent where xhtml9 = Address+instance XHtml9 AContent where xhtml9 = A+instance XHtml9 ObjectContent where xhtml9 = Object+instance XHtml9 FormContent where xhtml9 = Form+instance XHtml9 FieldsetContent where xhtml9 = Fieldset++class XHtml10 c where+ xhtml10 :: Node -> c++instance XHtml10 BlockContent where xhtml10 = Block+instance XHtml10 InlineContent where xhtml10 = Inline+instance XHtml10 AddressContent where xhtml10 = Address+instance XHtml10 PreContent where xhtml10 = Pre+instance XHtml10 AContent where xhtml10 = A+instance XHtml10 ObjectContent where xhtml10 = Object+instance XHtml10 MapContent where xhtml10 = Map+instance XHtml10 FormContent where xhtml10 = Form+instance XHtml10 FieldsetContent where xhtml10 = Fieldset+instance XHtml10 ButtonContent where xhtml10 = Button++class XHtml11 c where+ xhtml11 :: Node -> c++instance XHtml11 BlockContent where xhtml11 = Block+instance XHtml11 AddressContent where xhtml11 = Address+instance XHtml11 ObjectContent where xhtml11 = Object+instance XHtml11 MapContent where xhtml11 = Map+instance XHtml11 FormContent where xhtml11 = Form+instance XHtml11 FieldsetContent where xhtml11 = Fieldset+instance XHtml11 ButtonContent where xhtml11 = Button++class XHtml12 c where+ xhtml12 :: Node -> c++instance XHtml12 BlockContent where xhtml12 = Block+instance XHtml12 InlineContent where xhtml12 = Inline+instance XHtml12 AddressContent where xhtml12 = Address+instance XHtml12 PreContent where xhtml12 = Pre+instance XHtml12 ObjectContent where xhtml12 = Object+instance XHtml12 FormContent where xhtml12 = Form+instance XHtml12 FieldsetContent where xhtml12 = Fieldset++class XHtml13 c where+ xhtml13 :: Node -> c++instance XHtml13 HeadContent where xhtml13 = Head+instance XHtml13 BlockContent where xhtml13 = Block+instance XHtml13 InlineContent where xhtml13 = Inline+instance XHtml13 AddressContent where xhtml13 = Address+instance XHtml13 AContent where xhtml13 = A+instance XHtml13 ObjectContent where xhtml13 = Object+instance XHtml13 FormContent where xhtml13 = Form+instance XHtml13 FieldsetContent where xhtml13 = Fieldset+instance XHtml13 ButtonContent where xhtml13 = Button++class XHtml14 c where+ xhtml14 :: Node -> c++instance XHtml14 BlockContent where xhtml14 = Block+instance XHtml14 ObjectContent where xhtml14 = Object+instance XHtml14 MapContent where xhtml14 = Map+instance XHtml14 FieldsetContent where xhtml14 = Fieldset++class XHtml15 c where+ xhtml15 :: Node -> c++instance XHtml15 BlockContent where xhtml15 = Block+instance XHtml15 ObjectContent where xhtml15 = Object+instance XHtml15 MapContent where xhtml15 = Map+instance XHtml15 FormContent where xhtml15 = Form+instance XHtml15 FieldsetContent where xhtml15 = Fieldset++class XHtml16 c where+ xhtml16 :: Node -> c++instance XHtml16 TableContent where xhtml16 = Table+instance XHtml16 TableSectionContent where xhtml16 = TableSection++newtype HtmlContent = Html { htmlToNode :: Node }++instance Content HtmlContent where+ toContent = htmlToNode++html' :: (Functor t, Monad t) => Attrs -> XHtmlT t HtmlContent -> XHtmlT t Root+html' = tellNode Root "html" []++html :: (Functor t, Monad t) => XHtmlT t HtmlContent -> XHtmlT t Root+html = tellNode Root "html" [] []++newtype HeadContent = Head { headToNode :: Node }++instance Content HeadContent where+ toContent = headToNode++head' :: (Functor t, Monad t) => Attrs -> XHtmlT t HeadContent -> XHtmlT t HtmlContent+head' = tellNode Html "head" []++head_ :: (Functor t, Monad t) => XHtmlT t HeadContent -> XHtmlT t HtmlContent+head_ = tellNode Html "head" [] []++title' :: (Functor t, Monad t) => Attrs -> Text -> XHtmlT t HeadContent+title' = tellTextNode Head "title" []++title :: (Functor t, Monad t) => Text -> XHtmlT t HeadContent+title = tellTextNode Head "title" [] []++style' :: (Functor t, Monad t)+ => Text -- ^ Required type attribute.+ -> Attrs -> Text -> XHtmlT t HeadContent+style' a = tellTextNode Head "style" [A.type_ a]++style :: (Functor t, Monad t)+ => Text -- ^ Required type attribute.+ -> Text -> XHtmlT t HeadContent+style a = tellTextNode Head "style" [A.type_ a] []++script' :: (Functor t, Monad t, XHtml1 c)+ => Text -- ^ Required type attribute.+ -> Attrs -> Text -> XHtmlT t c+script' a = tellTextNode xhtml1 "script" [A.type_ a]++script :: (Functor t, Monad t, XHtml1 c)+ => Text -- ^ Required type attribute.+ -> Text -> XHtmlT t c+script a = tellTextNode xhtml1 "script" [A.type_ a] []++option' :: (Functor t, Monad t, XHtml2 c) => Attrs -> Text -> XHtmlT t c+option' = tellTextNode xhtml2 "option" []++option :: (Functor t, Monad t, XHtml2 c) => Text -> XHtmlT t c+option = tellTextNode xhtml2 "option" [] []++textarea' :: (Functor t, Monad t, XHtml3 c)+ => Text -- ^ Required rows attribute.+ -> Text -- ^ Required cols attribute.+ -> Attrs -> Text -> XHtmlT t c+textarea' a b = tellTextNode xhtml3 "textarea" [A.rows a, A.cols b]++textarea :: (Functor t, Monad t, XHtml3 c)+ => Text -- ^ Required rows attribute.+ -> Text -- ^ Required cols attribute.+ -> Text -> XHtmlT t c+textarea a b = tellTextNode xhtml3 "textarea" [A.rows a, A.cols b] []++base' :: (Functor t, Monad t) => Attrs -> XHtmlT t HeadContent+base' = tellEmptyNode Head "base" []++base :: (Functor t, Monad t) => XHtmlT t HeadContent+base = tellEmptyNode Head "base" [] []++meta' :: (Functor t, Monad t)+ => Text -- ^ Required content attribute.+ -> Attrs -> XHtmlT t HeadContent+meta' a = tellEmptyNode Head "meta" [A.content a]++meta :: (Functor t, Monad t)+ => Text -- ^ Required content attribute.+ -> XHtmlT t HeadContent+meta a = tellEmptyNode Head "meta" [A.content a] []++link' :: (Functor t, Monad t) => Attrs -> XHtmlT t HeadContent+link' = tellEmptyNode Head "link" []++link :: (Functor t, Monad t) => XHtmlT t HeadContent+link = tellEmptyNode Head "link" [] []++hr' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t c+hr' = tellEmptyNode xhtml4 "hr" []++hr :: (Functor t, Monad t, XHtml4 c) => XHtmlT t c+hr = tellEmptyNode xhtml4 "hr" [] []++br' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t c+br' = tellEmptyNode xhtml5 "br" []++br :: (Functor t, Monad t, XHtml5 c) => XHtmlT t c+br = tellEmptyNode xhtml5 "br" [] []++basefont' :: (Functor t, Monad t, XHtml6 c)+ => Text -- ^ Required size attribute.+ -> Attrs -> XHtmlT t c+basefont' a = tellEmptyNode xhtml6 "basefont" [A.size a]++basefont :: (Functor t, Monad t, XHtml6 c)+ => Text -- ^ Required size attribute.+ -> XHtmlT t c+basefont a = tellEmptyNode xhtml6 "basefont" [A.size a] []++param' :: (Functor t, Monad t)+ => Text -- ^ Required name attribute.+ -> Attrs -> XHtmlT t ObjectContent+param' a = tellEmptyNode Object "param" [A.name a]++param :: (Functor t, Monad t)+ => Text -- ^ Required name attribute.+ -> XHtmlT t ObjectContent+param a = tellEmptyNode Object "param" [A.name a] []++img' :: (Functor t, Monad t, XHtml6 c)+ => Text -- ^ Required src attribute.+ -> Text -- ^ Required alt attribute.+ -> Attrs -> XHtmlT t c+img' a b = tellEmptyNode xhtml6 "img" [A.src a, A.alt b]++img :: (Functor t, Monad t, XHtml6 c)+ => Text -- ^ Required src attribute.+ -> Text -- ^ Required alt attribute.+ -> XHtmlT t c+img a b = tellEmptyNode xhtml6 "img" [A.src a, A.alt b] []++area' :: (Functor t, Monad t)+ => Text -- ^ Required alt attribute.+ -> Attrs -> XHtmlT t MapContent+area' a = tellEmptyNode Map "area" [A.alt a]++area :: (Functor t, Monad t)+ => Text -- ^ Required alt attribute.+ -> XHtmlT t MapContent+area a = tellEmptyNode Map "area" [A.alt a] []++input' :: (Functor t, Monad t, XHtml3 c) => Attrs -> XHtmlT t c+input' = tellEmptyNode xhtml3 "input" []++input :: (Functor t, Monad t, XHtml3 c) => XHtmlT t c+input = tellEmptyNode xhtml3 "input" [] []++isindex' :: (Functor t, Monad t, XHtml7 c) => Attrs -> XHtmlT t c+isindex' = tellEmptyNode xhtml7 "isindex" []++isindex :: (Functor t, Monad t, XHtml7 c) => XHtmlT t c+isindex = tellEmptyNode xhtml7 "isindex" [] []++col' :: (Functor t, Monad t, XHtml8 c) => Attrs -> XHtmlT t c+col' = tellEmptyNode xhtml8 "col" []++col :: (Functor t, Monad t, XHtml8 c) => XHtmlT t c+col = tellEmptyNode xhtml8 "col" [] []++newtype BlockContent = Block { blockToNode :: Node }++instance Content BlockContent where+ toContent = blockToNode++instance CData BlockContent where+ cdata = Block . TextNode++noscript' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t BlockContent -> XHtmlT t c+noscript' = tellNode xhtml4 "noscript" []++noscript :: (Functor t, Monad t, XHtml4 c) => XHtmlT t BlockContent -> XHtmlT t c+noscript = tellNode xhtml4 "noscript" [] []++iframe' :: (Functor t, Monad t, XHtml9 c) => Attrs -> XHtmlT t BlockContent -> XHtmlT t c+iframe' = tellNode xhtml9 "iframe" []++iframe :: (Functor t, Monad t, XHtml9 c) => XHtmlT t BlockContent -> XHtmlT t c+iframe = tellNode xhtml9 "iframe" [] []++noframes' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t BlockContent -> XHtmlT t c+noframes' = tellNode xhtml4 "noframes" []++noframes :: (Functor t, Monad t, XHtml4 c) => XHtmlT t BlockContent -> XHtmlT t c+noframes = tellNode xhtml4 "noframes" [] []++body' :: (Functor t, Monad t) => Attrs -> XHtmlT t BlockContent -> XHtmlT t HtmlContent+body' = tellNode Html "body" []++body :: (Functor t, Monad t) => XHtmlT t BlockContent -> XHtmlT t HtmlContent+body = tellNode Html "body" [] []++div' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t BlockContent -> XHtmlT t c+div' = tellNode xhtml4 "div" []++div_ :: (Functor t, Monad t, XHtml4 c) => XHtmlT t BlockContent -> XHtmlT t c+div_ = tellNode xhtml4 "div" [] []++li' :: (Functor t, Monad t) => Attrs -> XHtmlT t BlockContent -> XHtmlT t ListContent+li' = tellNode List "li" []++li :: (Functor t, Monad t) => XHtmlT t BlockContent -> XHtmlT t ListContent+li = tellNode List "li" [] []++dd' :: (Functor t, Monad t) => Attrs -> XHtmlT t BlockContent -> XHtmlT t DlContent+dd' = tellNode Dl "dd" []++dd :: (Functor t, Monad t) => XHtmlT t BlockContent -> XHtmlT t DlContent+dd = tellNode Dl "dd" [] []++blockquote' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t BlockContent -> XHtmlT t c+blockquote' = tellNode xhtml4 "blockquote" []++blockquote :: (Functor t, Monad t, XHtml4 c) => XHtmlT t BlockContent -> XHtmlT t c+blockquote = tellNode xhtml4 "blockquote" [] []++center' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t BlockContent -> XHtmlT t c+center' = tellNode xhtml4 "center" []++center :: (Functor t, Monad t, XHtml4 c) => XHtmlT t BlockContent -> XHtmlT t c+center = tellNode xhtml4 "center" [] []++ins' :: (Functor t, Monad t, XHtml10 c) => Attrs -> XHtmlT t BlockContent -> XHtmlT t c+ins' = tellNode xhtml10 "ins" []++ins :: (Functor t, Monad t, XHtml10 c) => XHtmlT t BlockContent -> XHtmlT t c+ins = tellNode xhtml10 "ins" [] []++del' :: (Functor t, Monad t, XHtml10 c) => Attrs -> XHtmlT t BlockContent -> XHtmlT t c+del' = tellNode xhtml10 "del" []++del :: (Functor t, Monad t, XHtml10 c) => XHtmlT t BlockContent -> XHtmlT t c+del = tellNode xhtml10 "del" [] []++th' :: (Functor t, Monad t) => Attrs -> XHtmlT t BlockContent -> XHtmlT t TrContent+th' = tellNode Tr "th" []++th :: (Functor t, Monad t) => XHtmlT t BlockContent -> XHtmlT t TrContent+th = tellNode Tr "th" [] []++td' :: (Functor t, Monad t) => Attrs -> XHtmlT t BlockContent -> XHtmlT t TrContent+td' = tellNode Tr "td" []++td :: (Functor t, Monad t) => XHtmlT t BlockContent -> XHtmlT t TrContent+td = tellNode Tr "td" [] []++newtype InlineContent = Inline { inlineToNode :: Node }++instance Content InlineContent where+ toContent = inlineToNode++instance CData InlineContent where+ cdata = Inline . TextNode++p' :: (Functor t, Monad t, XHtml11 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+p' = tellNode xhtml11 "p" []++p :: (Functor t, Monad t, XHtml11 c) => XHtmlT t InlineContent -> XHtmlT t c+p = tellNode xhtml11 "p" [] []++h1' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+h1' = tellNode xhtml4 "h1" []++h1 :: (Functor t, Monad t, XHtml4 c) => XHtmlT t InlineContent -> XHtmlT t c+h1 = tellNode xhtml4 "h1" [] []++h2' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+h2' = tellNode xhtml4 "h2" []++h2 :: (Functor t, Monad t, XHtml4 c) => XHtmlT t InlineContent -> XHtmlT t c+h2 = tellNode xhtml4 "h2" [] []++h3' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+h3' = tellNode xhtml4 "h3" []++h3 :: (Functor t, Monad t, XHtml4 c) => XHtmlT t InlineContent -> XHtmlT t c+h3 = tellNode xhtml4 "h3" [] []++h4' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+h4' = tellNode xhtml4 "h4" []++h4 :: (Functor t, Monad t, XHtml4 c) => XHtmlT t InlineContent -> XHtmlT t c+h4 = tellNode xhtml4 "h4" [] []++h5' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+h5' = tellNode xhtml4 "h5" []++h5 :: (Functor t, Monad t, XHtml4 c) => XHtmlT t InlineContent -> XHtmlT t c+h5 = tellNode xhtml4 "h5" [] []++h6' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+h6' = tellNode xhtml4 "h6" []++h6 :: (Functor t, Monad t, XHtml4 c) => XHtmlT t InlineContent -> XHtmlT t c+h6 = tellNode xhtml4 "h6" [] []++dt' :: (Functor t, Monad t) => Attrs -> XHtmlT t InlineContent -> XHtmlT t DlContent+dt' = tellNode Dl "dt" []++dt :: (Functor t, Monad t) => XHtmlT t InlineContent -> XHtmlT t DlContent+dt = tellNode Dl "dt" [] []++span' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+span' = tellNode xhtml5 "span" []++span_ :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+span_ = tellNode xhtml5 "span" [] []++bdo' :: (Functor t, Monad t, XHtml5 c)+ => Text -- ^ Required dir attribute.+ -> Attrs -> XHtmlT t InlineContent -> XHtmlT t c+bdo' a = tellNode xhtml5 "bdo" [A.dir a]++bdo :: (Functor t, Monad t, XHtml5 c)+ => Text -- ^ Required dir attribute.+ -> XHtmlT t InlineContent -> XHtmlT t c+bdo a = tellNode xhtml5 "bdo" [A.dir a] []++em' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+em' = tellNode xhtml5 "em" []++em :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+em = tellNode xhtml5 "em" [] []++strong' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+strong' = tellNode xhtml5 "strong" []++strong :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+strong = tellNode xhtml5 "strong" [] []++dfn' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+dfn' = tellNode xhtml5 "dfn" []++dfn :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+dfn = tellNode xhtml5 "dfn" [] []++code' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+code' = tellNode xhtml5 "code" []++code :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+code = tellNode xhtml5 "code" [] []++samp' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+samp' = tellNode xhtml5 "samp" []++samp :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+samp = tellNode xhtml5 "samp" [] []++kbd' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+kbd' = tellNode xhtml5 "kbd" []++kbd :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+kbd = tellNode xhtml5 "kbd" [] []++var' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+var' = tellNode xhtml5 "var" []++var :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+var = tellNode xhtml5 "var" [] []++cite' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+cite' = tellNode xhtml5 "cite" []++cite :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+cite = tellNode xhtml5 "cite" [] []++abbr' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+abbr' = tellNode xhtml5 "abbr" []++abbr :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+abbr = tellNode xhtml5 "abbr" [] []++acronym' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+acronym' = tellNode xhtml5 "acronym" []++acronym :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+acronym = tellNode xhtml5 "acronym" [] []++q' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+q' = tellNode xhtml5 "q" []++q :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+q = tellNode xhtml5 "q" [] []++sub' :: (Functor t, Monad t, XHtml6 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+sub' = tellNode xhtml6 "sub" []++sub :: (Functor t, Monad t, XHtml6 c) => XHtmlT t InlineContent -> XHtmlT t c+sub = tellNode xhtml6 "sub" [] []++sup' :: (Functor t, Monad t, XHtml6 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+sup' = tellNode xhtml6 "sup" []++sup :: (Functor t, Monad t, XHtml6 c) => XHtmlT t InlineContent -> XHtmlT t c+sup = tellNode xhtml6 "sup" [] []++tt' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+tt' = tellNode xhtml5 "tt" []++tt :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+tt = tellNode xhtml5 "tt" [] []++i' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+i' = tellNode xhtml5 "i" []++i :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+i = tellNode xhtml5 "i" [] []++b' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+b' = tellNode xhtml5 "b" []++b :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+b = tellNode xhtml5 "b" [] []++big' :: (Functor t, Monad t, XHtml6 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+big' = tellNode xhtml6 "big" []++big :: (Functor t, Monad t, XHtml6 c) => XHtmlT t InlineContent -> XHtmlT t c+big = tellNode xhtml6 "big" [] []++small' :: (Functor t, Monad t, XHtml6 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+small' = tellNode xhtml6 "small" []++small :: (Functor t, Monad t, XHtml6 c) => XHtmlT t InlineContent -> XHtmlT t c+small = tellNode xhtml6 "small" [] []++u' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+u' = tellNode xhtml5 "u" []++u :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+u = tellNode xhtml5 "u" [] []++s' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+s' = tellNode xhtml5 "s" []++s :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+s = tellNode xhtml5 "s" [] []++strike' :: (Functor t, Monad t, XHtml5 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+strike' = tellNode xhtml5 "strike" []++strike :: (Functor t, Monad t, XHtml5 c) => XHtmlT t InlineContent -> XHtmlT t c+strike = tellNode xhtml5 "strike" [] []++font' :: (Functor t, Monad t, XHtml6 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+font' = tellNode xhtml6 "font" []++font :: (Functor t, Monad t, XHtml6 c) => XHtmlT t InlineContent -> XHtmlT t c+font = tellNode xhtml6 "font" [] []++label' :: (Functor t, Monad t, XHtml3 c) => Attrs -> XHtmlT t InlineContent -> XHtmlT t c+label' = tellNode xhtml3 "label" []++label :: (Functor t, Monad t, XHtml3 c) => XHtmlT t InlineContent -> XHtmlT t c+label = tellNode xhtml3 "label" [] []++legend' :: (Functor t, Monad t) => Attrs -> XHtmlT t InlineContent -> XHtmlT t FieldsetContent+legend' = tellNode Fieldset "legend" []++legend :: (Functor t, Monad t) => XHtmlT t InlineContent -> XHtmlT t FieldsetContent+legend = tellNode Fieldset "legend" [] []++caption' :: (Functor t, Monad t) => Attrs -> XHtmlT t InlineContent -> XHtmlT t TableContent+caption' = tellNode Table "caption" []++caption :: (Functor t, Monad t) => XHtmlT t InlineContent -> XHtmlT t TableContent+caption = tellNode Table "caption" [] []++newtype ListContent = List { listToNode :: Node }++instance Content ListContent where+ toContent = listToNode++ul' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t ListContent -> XHtmlT t c+ul' = tellNode xhtml4 "ul" []++ul :: (Functor t, Monad t, XHtml4 c) => XHtmlT t ListContent -> XHtmlT t c+ul = tellNode xhtml4 "ul" [] []++ol' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t ListContent -> XHtmlT t c+ol' = tellNode xhtml4 "ol" []++ol :: (Functor t, Monad t, XHtml4 c) => XHtmlT t ListContent -> XHtmlT t c+ol = tellNode xhtml4 "ol" [] []++menu' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t ListContent -> XHtmlT t c+menu' = tellNode xhtml4 "menu" []++menu :: (Functor t, Monad t, XHtml4 c) => XHtmlT t ListContent -> XHtmlT t c+menu = tellNode xhtml4 "menu" [] []++dir' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t ListContent -> XHtmlT t c+dir' = tellNode xhtml4 "dir" []++dir :: (Functor t, Monad t, XHtml4 c) => XHtmlT t ListContent -> XHtmlT t c+dir = tellNode xhtml4 "dir" [] []++newtype DlContent = Dl { dlToNode :: Node }++instance Content DlContent where+ toContent = dlToNode++dl' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t DlContent -> XHtmlT t c+dl' = tellNode xhtml4 "dl" []++dl :: (Functor t, Monad t, XHtml4 c) => XHtmlT t DlContent -> XHtmlT t c+dl = tellNode xhtml4 "dl" [] []++newtype AddressContent = Address { addressToNode :: Node }++instance Content AddressContent where+ toContent = addressToNode++instance CData AddressContent where+ cdata = Address . TextNode++address' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t AddressContent -> XHtmlT t c+address' = tellNode xhtml4 "address" []++address :: (Functor t, Monad t, XHtml4 c) => XHtmlT t AddressContent -> XHtmlT t c+address = tellNode xhtml4 "address" [] []++newtype PreContent = Pre { preToNode :: Node }++instance Content PreContent where+ toContent = preToNode++instance CData PreContent where+ cdata = Pre . TextNode++pre' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t PreContent -> XHtmlT t c+pre' = tellNode xhtml4 "pre" []++pre :: (Functor t, Monad t, XHtml4 c) => XHtmlT t PreContent -> XHtmlT t c+pre = tellNode xhtml4 "pre" [] []++newtype AContent = A { aToNode :: Node }++instance Content AContent where+ toContent = aToNode++instance CData AContent where+ cdata = A . TextNode++a' :: (Functor t, Monad t, XHtml12 c) => Attrs -> XHtmlT t AContent -> XHtmlT t c+a' = tellNode xhtml12 "a" []++a :: (Functor t, Monad t, XHtml12 c) => XHtmlT t AContent -> XHtmlT t c+a = tellNode xhtml12 "a" [] []++newtype ObjectContent = Object { objectToNode :: Node }++instance Content ObjectContent where+ toContent = objectToNode++instance CData ObjectContent where+ cdata = Object . TextNode++object' :: (Functor t, Monad t, XHtml13 c) => Attrs -> XHtmlT t ObjectContent -> XHtmlT t c+object' = tellNode xhtml13 "object" []++object :: (Functor t, Monad t, XHtml13 c) => XHtmlT t ObjectContent -> XHtmlT t c+object = tellNode xhtml13 "object" [] []++applet' :: (Functor t, Monad t, XHtml6 c)+ => Text -- ^ Required width attribute.+ -> Text -- ^ Required height attribute.+ -> Attrs -> XHtmlT t ObjectContent -> XHtmlT t c+applet' a b = tellNode xhtml6 "applet" [A.width a, A.height b]++applet :: (Functor t, Monad t, XHtml6 c)+ => Text -- ^ Required width attribute.+ -> Text -- ^ Required height attribute.+ -> XHtmlT t ObjectContent -> XHtmlT t c+applet a b = tellNode xhtml6 "applet" [A.width a, A.height b] []++newtype MapContent = Map { mapToNode :: Node }++instance Content MapContent where+ toContent = mapToNode++map' :: (Functor t, Monad t, XHtml6 c)+ => Text -- ^ Required id attribute.+ -> Attrs -> XHtmlT t MapContent -> XHtmlT t c+map' a = tellNode xhtml6 "map" [A.id a]++map_ :: (Functor t, Monad t, XHtml6 c)+ => Text -- ^ Required id attribute.+ -> XHtmlT t MapContent -> XHtmlT t c+map_ a = tellNode xhtml6 "map" [A.id a] []++newtype FormContent = Form { formToNode :: Node }++instance Content FormContent where+ toContent = formToNode++instance CData FormContent where+ cdata = Form . TextNode++form' :: (Functor t, Monad t, XHtml14 c)+ => Text -- ^ Required action attribute.+ -> Attrs -> XHtmlT t FormContent -> XHtmlT t c+form' a = tellNode xhtml14 "form" [A.action a]++form :: (Functor t, Monad t, XHtml14 c)+ => Text -- ^ Required action attribute.+ -> XHtmlT t FormContent -> XHtmlT t c+form a = tellNode xhtml14 "form" [A.action a] []++newtype SelectContent = Select { selectToNode :: Node }++instance Content SelectContent where+ toContent = selectToNode++select' :: (Functor t, Monad t, XHtml3 c) => Attrs -> XHtmlT t SelectContent -> XHtmlT t c+select' = tellNode xhtml3 "select" []++select :: (Functor t, Monad t, XHtml3 c) => XHtmlT t SelectContent -> XHtmlT t c+select = tellNode xhtml3 "select" [] []++newtype OptgroupContent = Optgroup { optgroupToNode :: Node }++instance Content OptgroupContent where+ toContent = optgroupToNode++optgroup' :: (Functor t, Monad t)+ => Text -- ^ Required label attribute.+ -> Attrs -> XHtmlT t OptgroupContent -> XHtmlT t SelectContent+optgroup' a = tellNode Select "optgroup" [A.label a]++optgroup :: (Functor t, Monad t)+ => Text -- ^ Required label attribute.+ -> XHtmlT t OptgroupContent -> XHtmlT t SelectContent+optgroup a = tellNode Select "optgroup" [A.label a] []++newtype FieldsetContent = Fieldset { fieldsetToNode :: Node }++instance Content FieldsetContent where+ toContent = fieldsetToNode++instance CData FieldsetContent where+ cdata = Fieldset . TextNode++fieldset' :: (Functor t, Monad t, XHtml15 c) => Attrs -> XHtmlT t FieldsetContent -> XHtmlT t c+fieldset' = tellNode xhtml15 "fieldset" []++fieldset :: (Functor t, Monad t, XHtml15 c) => XHtmlT t FieldsetContent -> XHtmlT t c+fieldset = tellNode xhtml15 "fieldset" [] []++newtype ButtonContent = Button { buttonToNode :: Node }++instance Content ButtonContent where+ toContent = buttonToNode++instance CData ButtonContent where+ cdata = Button . TextNode++button' :: (Functor t, Monad t, XHtml3 c) => Attrs -> XHtmlT t ButtonContent -> XHtmlT t c+button' = tellNode xhtml3 "button" []++button :: (Functor t, Monad t, XHtml3 c) => XHtmlT t ButtonContent -> XHtmlT t c+button = tellNode xhtml3 "button" [] []++newtype TableContent = Table { tableToNode :: Node }++instance Content TableContent where+ toContent = tableToNode++table' :: (Functor t, Monad t, XHtml4 c) => Attrs -> XHtmlT t TableContent -> XHtmlT t c+table' = tellNode xhtml4 "table" []++table :: (Functor t, Monad t, XHtml4 c) => XHtmlT t TableContent -> XHtmlT t c+table = tellNode xhtml4 "table" [] []++newtype TableSectionContent = TableSection { tablesectionToNode :: Node }++instance Content TableSectionContent where+ toContent = tablesectionToNode++thead' :: (Functor t, Monad t) => Attrs -> XHtmlT t TableSectionContent -> XHtmlT t TableContent+thead' = tellNode Table "thead" []++thead :: (Functor t, Monad t) => XHtmlT t TableSectionContent -> XHtmlT t TableContent+thead = tellNode Table "thead" [] []++tfoot' :: (Functor t, Monad t) => Attrs -> XHtmlT t TableSectionContent -> XHtmlT t TableContent+tfoot' = tellNode Table "tfoot" []++tfoot :: (Functor t, Monad t) => XHtmlT t TableSectionContent -> XHtmlT t TableContent+tfoot = tellNode Table "tfoot" [] []++tbody' :: (Functor t, Monad t) => Attrs -> XHtmlT t TableSectionContent -> XHtmlT t TableContent+tbody' = tellNode Table "tbody" []++tbody :: (Functor t, Monad t) => XHtmlT t TableSectionContent -> XHtmlT t TableContent+tbody = tellNode Table "tbody" [] []++newtype ColgroupContent = Colgroup { colgroupToNode :: Node }++instance Content ColgroupContent where+ toContent = colgroupToNode++colgroup' :: (Functor t, Monad t) => Attrs -> XHtmlT t ColgroupContent -> XHtmlT t TableContent+colgroup' = tellNode Table "colgroup" []++colgroup :: (Functor t, Monad t) => XHtmlT t ColgroupContent -> XHtmlT t TableContent+colgroup = tellNode Table "colgroup" [] []++newtype TrContent = Tr { trToNode :: Node }++instance Content TrContent where+ toContent = trToNode++tr' :: (Functor t, Monad t, XHtml16 c) => Attrs -> XHtmlT t TrContent -> XHtmlT t c+tr' = tellNode xhtml16 "tr" []++tr :: (Functor t, Monad t, XHtml16 c) => XHtmlT t TrContent -> XHtmlT t c+tr = tellNode xhtml16 "tr" [] []
+ src/Text/XHtmlCombinators/Transitional/Attributes.hs view
@@ -0,0 +1,125 @@+module Text.XHtmlCombinators.Transitional.Attributes where++import Data.Text (Text)+import Text.XHtmlCombinators.Internal++lang t = Attr "lang" t+xml_lang t = Attr "xml:lang" t+dir t = Attr "dir" t+id t = Attr "id" t+xmlns t = Attr "xmlns" t+profile t = Attr "profile" t+href t = Attr "href" t+target t = Attr "target" t+http_equiv t = Attr "http-equiv" t+name t = Attr "name" t+content t = Attr "content" t+scheme t = Attr "scheme" t+class_ t = Attr "class" t+style t = Attr "style" t+title t = Attr "title" t+onclick t = Attr "onclick" t+ondblclick t = Attr "ondblclick" t+onmousedown t = Attr "onmousedown" t+onmouseup t = Attr "onmouseup" t+onmouseover t = Attr "onmouseover" t+onmousemove t = Attr "onmousemove" t+onmouseout t = Attr "onmouseout" t+onkeypress t = Attr "onkeypress" t+onkeydown t = Attr "onkeydown" t+onkeyup t = Attr "onkeyup" t+charset t = Attr "charset" t+hreflang t = Attr "hreflang" t+type_ t = Attr "type" t+rel t = Attr "rel" t+rev t = Attr "rev" t+media t = Attr "media" t+xml_space t = Attr "xml:space" t+language t = Attr "language" t+src t = Attr "src" t+defer t = Attr "defer" t+longdesc t = Attr "longdesc" t+frameborder t = Attr "frameborder" t+marginwidth t = Attr "marginwidth" t+marginheight t = Attr "marginheight" t+scrolling t = Attr "scrolling" t+align t = Attr "align" t+height t = Attr "height" t+width t = Attr "width" t+onload t = Attr "onload" t+onunload t = Attr "onunload" t+background t = Attr "background" t+bgcolor t = Attr "bgcolor" t+text t = Attr "text" t+link t = Attr "link" t+vlink t = Attr "vlink" t+alink t = Attr "alink" t+compact t = Attr "compact" t+start t = Attr "start" t+value t = Attr "value" t+noshade t = Attr "noshade" t+size t = Attr "size" t+cite t = Attr "cite" t+datetime t = Attr "datetime" t+accesskey t = Attr "accesskey" t+tabindex t = Attr "tabindex" t+onfocus t = Attr "onfocus" t+onblur t = Attr "onblur" t+shape t = Attr "shape" t+coords t = Attr "coords" t+clear t = Attr "clear" t+color t = Attr "color" t+face t = Attr "face" t+declare t = Attr "declare" t+classid t = Attr "classid" t+codebase t = Attr "codebase" t+data_ t = Attr "data" t+codetype t = Attr "codetype" t+archive t = Attr "archive" t+standby t = Attr "standby" t+usemap t = Attr "usemap" t+border t = Attr "border" t+hspace t = Attr "hspace" t+vspace t = Attr "vspace" t+valuetype t = Attr "valuetype" t+code t = Attr "code" t+object t = Attr "object" t+alt t = Attr "alt" t+ismap t = Attr "ismap" t+nohref t = Attr "nohref" t+action t = Attr "action" t+method t = Attr "method" t+enctype t = Attr "enctype" t+onsubmit t = Attr "onsubmit" t+onreset t = Attr "onreset" t+accept t = Attr "accept" t+accept_charset t = Attr "accept-charset" t+for t = Attr "for" t+checked t = Attr "checked" t+disabled t = Attr "disabled" t+readonly t = Attr "readonly" t+maxlength t = Attr "maxlength" t+onselect t = Attr "onselect" t+onchange t = Attr "onchange" t+multiple t = Attr "multiple" t+label t = Attr "label" t+selected t = Attr "selected" t+rows t = Attr "rows" t+cols t = Attr "cols" t+prompt t = Attr "prompt" t+summary t = Attr "summary" t+frame t = Attr "frame" t+rules t = Attr "rules" t+cellspacing t = Attr "cellspacing" t+cellpadding t = Attr "cellpadding" t+char t = Attr "char" t+charoff t = Attr "charoff" t+valign t = Attr "valign" t+span t = Attr "span" t+abbr t = Attr "abbr" t+axis t = Attr "axis" t+headers t = Attr "headers" t+scope t = Attr "scope" t+rowspan t = Attr "rowspan" t+colspan t = Attr "colspan" t+nowrap t = Attr "nowrap" t
xhtml-combinators.cabal view
@@ -1,9 +1,9 @@ name: xhtml-combinators-version: 0.2.2+version: 0.3 cabal-version: >= 1.2.3 synopsis: Fast and easy to use XHTML combinators.-description: - xhtml-combinators provides a set of (hopefully!) fast and +description:+ xhtml-combinators provides a set of (hopefully!) fast and easy to use XHTML 1.0 Strict combinators built on top of the Data.Text library. category: Web, Text@@ -15,21 +15,18 @@ build-type: Simple library- build-depends: + build-depends: base < 5, containers, random, transformers >= 0.2, xml >= 1.3.5, text >= 0.7 hs-source-dirs: src- exposed-modules: + exposed-modules: Text.XHtmlCombinators- Text.XHtmlCombinators.Safe Text.XHtmlCombinators.Attributes- Text.XHtmlCombinators.Attributes.Safe- Text.XHtmlCombinators.Escape- Text.XHtmlCombinators.Render- Text.XHtmlCombinators.Extras.Lorem- other-modules:+ Text.XHtmlCombinators.Strict+ Text.XHtmlCombinators.Strict.Attributes+ Text.XHtmlCombinators.Transitional+ Text.XHtmlCombinators.Transitional.Attributes+ Text.XHtmlCombinators.Frameset+ Text.XHtmlCombinators.Frameset.Attributes Text.XHtmlCombinators.Internal- Text.XHtmlCombinators.Combinators- Text.XHtmlCombinators.Attributes.Internal- Text.XHtmlCombinators.Attributes.Internal.Safe+ Text.XHtmlCombinators.Render extensions: OverloadedStrings, PatternGuards- ghc-options: -O2