Text.CSS.Parse

css-text-0.1.3.0: CSS parser and renderer.

Safe Haskell | Safe-Inferred
Language | Haskell2010

Text.CSS.Parse

Description

Parse CSS with parseNestedBlocks and render it with renderNestedBlock

Synopsis

- data NestedBlock
  - = NestedBlock Text [NestedBlock]
  - | LeafBlock CssBlock
- parseNestedBlocks :: Text -> Either String [NestedBlock]
- parseBlocks :: Text -> Either String [CssBlock]
- parseBlock :: Text -> Either String CssBlock
- attrParser :: Parser (Text, Text)
- attrsParser :: Parser [(Text, Text)]
- blockParser :: Parser (Text, [(Text, Text)])
- blocksParser :: Parser [(Text, [(Text, Text)])]
- parseAttr :: Text -> Either String (Text, Text)
- parseAttrs :: Text -> Either String [(Text, Text)]

# Documentation

data NestedBlock #

Constructors

NestedBlock Text [NestedBlock] | for example a media query
LeafBlock CssBlock |

#### Instances

Instances details

Show NestedBlock # |
Instance details Defined in Text.CSS.Parse Methods showsPrec :: Int -> NestedBlock -> ShowS # show :: NestedBlock -> String # showList :: [NestedBlock] -> ShowS #
Eq NestedBlock # |
Instance details Defined in Text.CSS.Parse Methods (==) :: NestedBlock -> NestedBlock -> Bool # (/=) :: NestedBlock -> NestedBlock -> Bool #

parseNestedBlocks :: Text -> Either String [NestedBlock] #

The preferred parser, will capture media queries

parseBlocks :: Text -> Either String [CssBlock] #

The original parser of basic CSS, but throws out media queries

parseBlock :: Text -> Either String CssBlock #

attrParser :: Parser (Text, Text) #

attrsParser :: Parser [(Text, Text)] #

blockParser :: Parser (Text, [(Text, Text)]) #

blocksParser :: Parser [(Text, [(Text, Text)])] #

parseAttr :: Text -> Either String (Text, Text) #

parseAttrs :: Text -> Either String [(Text, Text)] #