summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregWeber <>2014-02-18 16:21:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2014-02-18 16:21:00 (GMT)
commit044a6be3f991ce83dd68b744ff5d1cb82df6fd30 (patch)
tree821da1d8df63b7dbadc41ac3604299086c99b3d5
parent37c9d7849f312c789b30a7252b9a5d1c133c10db (diff)
version 0.1.2.0.10.1.2.0.1
-rw-r--r--Text/CSS/Parse.hs14
-rw-r--r--Text/CSS/Render.hs9
-rw-r--r--css-text.cabal4
3 files changed, 15 insertions, 12 deletions
diff --git a/Text/CSS/Parse.hs b/Text/CSS/Parse.hs
index 76b20a0..c16a1ee 100644
--- a/Text/CSS/Parse.hs
+++ b/Text/CSS/Parse.hs
@@ -1,15 +1,16 @@
{-# LANGUAGE OverloadedStrings #-}
+-- | Parse CSS with parseNestedBlocks and render it with renderNestedBlock
module Text.CSS.Parse
- ( attrParser
+ ( NestedBlock(..)
+ , parseNestedBlocks
+ , parseBlocks
+ , parseBlock
+ , attrParser
, attrsParser
, blockParser
, blocksParser
, parseAttr
, parseAttrs
- , parseBlock
- , parseBlocks
- , parseNestedBlocks
- , NestedBlock(..)
) where
import Prelude hiding (takeWhile, take)
@@ -19,7 +20,7 @@ import Control.Applicative ((<|>), many, (<$>))
import Data.Char (isSpace)
type CssBlock = (Text, [(Text, Text)])
-data NestedBlock = NestedBlock Text [NestedBlock]
+data NestedBlock = NestedBlock Text [NestedBlock] -- ^ for example a media query
| LeafBlock CssBlock
deriving (Eq, Show)
@@ -27,6 +28,7 @@ data NestedBlock = NestedBlock Text [NestedBlock]
parseNestedBlocks :: Text -> Either String [NestedBlock]
parseNestedBlocks = parseOnly nestedBlocksParser
+-- | The original parser of basic CSS, but throws out media queries
parseBlocks :: Text -> Either String [CssBlock]
parseBlocks = parseOnly blocksParser
diff --git a/Text/CSS/Render.hs b/Text/CSS/Render.hs
index 30f4f3c..b68773f 100644
--- a/Text/CSS/Render.hs
+++ b/Text/CSS/Render.hs
@@ -1,10 +1,11 @@
{-# LANGUAGE OverloadedStrings #-}
+-- | Prender CSS with renderNestedBlocks
module Text.CSS.Render
- ( renderAttr
- , renderAttrs
- , renderBlock
+ ( renderNestedBlocks
, renderBlocks
- , renderNestedBlocks
+ , renderBlock
+ , renderAttrs
+ , renderAttr
) where
import Data.Text (Text)
diff --git a/css-text.cabal b/css-text.cabal
index 78b010f..5f48d37 100644
--- a/css-text.cabal
+++ b/css-text.cabal
@@ -1,9 +1,9 @@
name: css-text
-version: 0.1.2
+version: 0.1.2.0.1
license: BSD3
license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com>
-maintainer: Michael Snoyman <michael@snoyman.com>
+maintainer: Michael Snoyman <michael@snoyman.com>, Greg Weber <greg@gregweber.info>
synopsis: CSS parser and renderer.
category: Web, Yesod
stability: Stable