shakespeare-2.1.1: A toolkit for making compile-time interpolated templates

Safe Haskell | None
Language | Haskell2010

Text.Internal.Lucius

Synopsis

- luciusWithOrder :: Order -> QuasiQuoter
- luciusFromString :: Order -> String -> Q Exp
- whiteSpace :: Parser ()
- whiteSpace1 :: Parser ()
- parseBlock :: Order -> Parser (Block 'Unresolved)
- detectAmp :: Block 'Unresolved -> (Bool, Block 'Unresolved)
- partitionPBs :: Order -> [PairBlock] -> ([Either (Attr 'Unresolved) Deref], [Block 'Unresolved])
- parseSelector :: Parser [Contents]
- trim :: Contents -> Contents
- data PairBlock
  - = PBAttr (Attr 'Unresolved)
  - | PBBlock (Block 'Unresolved)
  - | PBMixin Deref
- parsePairsBlocks :: Order -> ([PairBlock] -> [PairBlock]) -> Parser [PairBlock]
- parsePair :: Parser (Attr 'Unresolved)
- parseContents :: String -> Parser Contents
- parseContent :: String -> Parser Content
- isHex :: Char -> Bool
- atMost :: Int -> Parser a -> Parser [a]
- parseComment :: Parser Content
- luciusFileWithOrd :: Order -> FilePath -> Q Exp
- luciusFileDebugWithOrder :: Order -> FilePath -> Q Exp
- parseTopLevels :: Order -> Parser [TopLevel 'Unresolved]
- stringCI :: String -> Parser ()
- luciusRTWithOrder' :: Order -> Text -> Either String ([(Text, Text)] -> Either String [TopLevel 'Resolved])
- luciusRTInternal :: Order -> Text -> Either String ([(Text, RTValue)] -> Either String [TopLevel 'Resolved])
- luciusRTWithOrder :: Order -> Text -> [(Text, Text)] -> Either String Text
- luciusRTMixinWithOrder :: Order -> Text -> Bool -> [(Text, RTValue)] -> Either String Text
- data RTValue
  - = RTVRaw Text
  - | RTVMixin Mixin
- luciusRTMinifiedWithOrder :: Order -> Text -> [(Text, Text)] -> Either String Text
- luciusUsedIdentifiers :: Order -> String -> [(Deref, VarType)]
- luciusMixinWithOrder :: Order -> QuasiQuoter
- luciusMixinFromString :: Order -> String -> Q Exp

# Documentation

luciusWithOrder :: Order -> QuasiQuoter #

luciusFromString :: Order -> String -> Q Exp #

whiteSpace :: Parser () #

whiteSpace1 :: Parser () #

parseBlock :: Order -> Parser (Block 'Unresolved) #

detectAmp :: Block 'Unresolved -> (Bool, Block 'Unresolved) #

Looks for an & at the beginning of a selector and, if present, indicates that we should not have a leading space. Otherwise, we should have the leading space.

partitionPBs :: Order -> [PairBlock] -> ([Either (Attr 'Unresolved) Deref], [Block 'Unresolved]) #

parseSelector :: Parser [Contents] #

trim :: Contents -> Contents #

data PairBlock #

Constructors

PBAttr (Attr 'Unresolved) |
PBBlock (Block 'Unresolved) |
PBMixin Deref |

parsePairsBlocks :: Order -> ([PairBlock] -> [PairBlock]) -> Parser [PairBlock] #

parsePair :: Parser (Attr 'Unresolved) #

parseContents :: String -> Parser Contents #

parseContent :: String -> Parser Content #

isHex :: Char -> Bool #

atMost :: Int -> Parser a -> Parser [a] #

parseComment :: Parser Content #

luciusFileWithOrd :: Order -> FilePath -> Q Exp #

luciusFileDebugWithOrder :: Order -> FilePath -> Q Exp #

parseTopLevels :: Order -> Parser [TopLevel 'Unresolved] #

stringCI :: String -> Parser () #

luciusRTWithOrder' #

Arguments

:: Order | Should we keep attributes and mixins order or not
-> Text |
-> Either String ([(Text, Text)] -> Either String [TopLevel 'Resolved]) |

luciusRTInternal :: Order -> Text -> Either String ([(Text, RTValue)] -> Either String [TopLevel 'Resolved]) #

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

luciusRTMixinWithOrder #

Arguments

:: Order |
-> Text | template
-> Bool | minify?
-> [(Text, RTValue)] | scope
-> Either String Text |

data RTValue #

Constructors

RTVRaw Text |
RTVMixin Mixin |

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

luciusUsedIdentifiers :: Order -> String -> [(Deref, VarType)] #

Determine which identifiers are used by the given template, useful for creating systems like yesod devel.

luciusMixinWithOrder :: Order -> QuasiQuoter #

luciusMixinFromString :: Order -> String -> Q Exp #