pencil-0.1.3: Static site generator

Safe HaskellNone
LanguageHaskell2010

Pencil.Internal.Env

Synopsis

Documentation

data Value Source #

Represents the data types found in an environment.

This includes at least Data.Aeson Value type (https:/hackage.haskell.orgpackageaeson-1.2.3.0docs/Data-Aeson.html#t:Value), plus other useful ones.

Instances
Eq Value Source # 
Instance details

Defined in Pencil.Internal.Env

Methods

(==) :: Value -> Value -> Bool #

(/=) :: Value -> Value -> Bool #

Show Value Source # 
Instance details

Defined in Pencil.Internal.Env

Methods

showsPrec :: Int -> Value -> ShowS #

show :: Value -> String #

showList :: [Value] -> ShowS #

type Env = HashMap Text Value Source #

Environment map of variables to Values.

toValue :: Value -> Maybe Value Source #

Converts an Aeson Value to a Pencil Value.

toText :: Value -> Text Source #

Render for human consumption. This is the default one. Pass into Config as part of the Reader?

toDateTime :: String -> Maybe UTCTime Source #

Accepted format is ISO 8601 (YYYY-MM-DD), optionally with an appended "THH:MM:SS". Example: 2010-01-30, 2010-01-30T09:08:00

maybeOrdering :: (Value -> Value -> Ordering) -> Maybe Value -> Maybe Value -> Ordering Source #

Define an ordering for possibly-missing Value. Nothings are ordered last.

dateOrdering :: Value -> Value -> Ordering Source #

Sort by newest first.

arrayContainsString :: Text -> Value -> Bool Source #

Returns true if the given Value is a VArray that contains the given string.