xhtml 3000.2.0.5 → 3000.2.1
raw patch · 7 files changed
+28/−22 lines, 7 files
Files
- .gitignore +0/−1
- .project +0/−11
- Text/XHtml/Frameset.hs +2/−2
- Text/XHtml/Internals.hs +20/−2
- Text/XHtml/Strict.hs +2/−2
- Text/XHtml/Transitional.hs +2/−2
- xhtml.cabal +2/−2
− .gitignore
@@ -1,1 +0,0 @@-.project
− .project
@@ -1,11 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>-<projectDescription>- <name>xhtml-3000.2.0.5</name>- <comment></comment>- <projects>- </projects>- <buildSpec>- </buildSpec>- <natures>- </natures>-</projectDescription>
Text/XHtml/Frameset.hs view
@@ -7,11 +7,11 @@ -- * Data types Html, HtmlAttr, -- * Classes- HTML(..), ADDATTRS(..),+ HTML(..), ADDATTRS(..), CHANGEATTRS(..), -- * Primitives and basic combinators (<<), concatHtml, (+++), noHtml, isNoHtml, tag, itag,- emptyAttr, intAttr, strAttr, htmlAttr,+ htmlAttrPair, emptyAttr, intAttr, strAttr, htmlAttr, primHtml, -- * Rendering showHtml, renderHtml, prettyHtml,
Text/XHtml/Internals.hs view
@@ -46,6 +46,10 @@ data HtmlAttr = HtmlAttr String String +htmlAttrPair :: HtmlAttr -> (String,String)+htmlAttrPair (HtmlAttr n v) = (n,v)++ newtype Html = Html { getHtmlElements :: [HtmlElement] } @@ -93,14 +97,28 @@ class ADDATTRS a where (!) :: a -> [HtmlAttr] -> a +-- | CHANGEATTRS is a more expressive alternative to ADDATTRS+class CHANGEATTRS a where+ changeAttrs :: a -> ([HtmlAttr]->[HtmlAttr]) -> a+ instance (ADDATTRS b) => ADDATTRS (a -> b) where- fn ! attr = \ arg -> fn arg ! attr+ fn ! attr = \ arg -> fn arg ! attr +instance (CHANGEATTRS b) => CHANGEATTRS (a -> b) where+ changeAttrs fn f = \ arg -> changeAttrs (fn arg) f+ instance ADDATTRS Html where (Html htmls) ! attr = Html (map addAttrs htmls) where addAttrs (html@(HtmlTag { markupAttrs = attrs }) )- = html { markupAttrs = attrs ++ attr }+ = html { markupAttrs = attrs ++ attr }+ addAttrs html = html++instance CHANGEATTRS Html where+ changeAttrs (Html htmls) f = Html (map addAttrs htmls)+ where+ addAttrs (html@(HtmlTag { markupAttrs = attrs }) )+ = html { markupAttrs = f attrs } addAttrs html = html
Text/XHtml/Strict.hs view
@@ -7,11 +7,11 @@ -- * Data types Html, HtmlAttr, -- * Classes- HTML(..), ADDATTRS(..),+ HTML(..), ADDATTRS(..), CHANGEATTRS(..), -- * Primitives and basic combinators (<<), concatHtml, (+++), noHtml, isNoHtml, tag, itag,- emptyAttr, intAttr, strAttr, htmlAttr,+ htmlAttrPair, emptyAttr, intAttr, strAttr, htmlAttr, primHtml, stringToHtmlString, docType, -- * Rendering
Text/XHtml/Transitional.hs view
@@ -7,11 +7,11 @@ -- * Data types Html, HtmlAttr, -- * Classes- HTML(..), ADDATTRS(..),+ HTML(..), ADDATTRS(..), CHANGEATTRS(..), -- * Primitives and basic combinators (<<), concatHtml, (+++), noHtml, isNoHtml, tag, itag,- emptyAttr, intAttr, strAttr, htmlAttr,+ htmlAttrPair, emptyAttr, intAttr, strAttr, htmlAttr, primHtml, -- * Rendering showHtml, renderHtml, prettyHtml,
xhtml.cabal view
@@ -1,5 +1,5 @@ Name: xhtml-Version: 3000.2.0.5+Version: 3000.2.1 Copyright: Bjorn Bringert 2004-2006, Andy Gill and the Oregon Graduate Institute of Science and Technology, 1999-2001 Maintainer: Chris Dornan <chris@chrisdornan.com>@@ -18,7 +18,7 @@ Source-repository head type: git- location: git@github.com:haskell/xhtml.git+ location: https://github.com/haskell/xhtml library Build-depends: base >= 4.0 && < 5.0