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

Safe HaskellNone
LanguageHaskell98

Text.Lucius

Contents

Synopsis

Parsing

lucius :: QuasiQuoter #

>>> renderCss ([lucius|foo{bar:baz}|] undefined)
"foo{bar:baz}"

Mixins

data Mixin #

Instances

Monoid Mixin # 

Methods

mempty :: Mixin #

mappend :: Mixin -> Mixin -> Mixin #

mconcat :: [Mixin] -> Mixin #

Lift Mixin # 

Methods

lift :: Mixin -> Q Exp #

Runtime

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

luciusRT' :: Text -> Either String ([(Text, Text)] -> Either String [TopLevel Resolved]) #

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

Same as luciusRT, but output has no added whitespace.

Since 1.0.3

Mixin

luciusRTMixin #

Arguments

:: Text

template

-> Bool

minify?

-> [(Text, RTValue)]

scope

-> Either String Text 

Runtime Lucius with mixin support.

Since 1.0.6

data RTValue #

Constructors

RTVRaw Text 
RTVMixin Mixin 

Datatypes

data Css #

type CssUrl url = (url -> [(Text, Text)] -> Text) -> Css #

Type class

class ToCss a where #

Minimal complete definition

toCss

Methods

toCss :: a -> Builder #

Instances

ToCss Text # 

Methods

toCss :: Text -> Builder #

ToCss Text # 

Methods

toCss :: Text -> Builder #

ToCss PercentageSize # 

Methods

toCss :: PercentageSize -> Builder #

ToCss AbsoluteSize # 

Methods

toCss :: AbsoluteSize -> Builder #

ToCss Color # 

Methods

toCss :: Color -> Builder #

ToCss EmSize # 

Methods

toCss :: EmSize -> Builder #

ToCss ExSize # 

Methods

toCss :: ExSize -> Builder #

ToCss PixelSize # 

Methods

toCss :: PixelSize -> Builder #

ToCss [Char] # 

Methods

toCss :: [Char] -> Builder #

Rendering

renderCss :: Css -> Text #

renderCssUrl :: (url -> [(Text, Text)] -> Text) -> CssUrl url -> Text #

ToCss instances

Color

data Color #

Constructors

Color Word8 Word8 Word8 

Instances

Show Color # 

Methods

showsPrec :: Int -> Color -> ShowS #

show :: Color -> String #

showList :: [Color] -> ShowS #

ToCss Color # 

Methods

toCss :: Color -> Builder #

Size

mkSize :: String -> ExpQ #

Create a CSS size, e.g. $(mkSize "100px").

absoluteSize :: AbsoluteUnit -> Rational -> AbsoluteSize #

Constructs AbsoluteSize. Not intended for direct use, see mkSize.

percentageSize :: Rational -> PercentageSize #

Constructs PercentageSize. Not intended for direct use, see mkSize.

Internal

parseTopLevels :: Parser [TopLevel Unresolved] #

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

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