hakyll-4.9.8.0: A static website compiler library

Safe Haskell | None
Language | Haskell98

Hakyll.Web.Template.Internal.Element

Description

Module containing the elements used in a template. A template is generally just a list of these elements.

Synopsis

- newtype TemplateKey = TemplateKey String
- data TemplateExpr
  - = Ident TemplateKey
  - | Call TemplateKey [TemplateExpr]
  - | StringLiteral String
- data TemplateElement
  - = Chunk String
  - | Expr TemplateExpr
  - | Escaped
  - | If TemplateExpr [TemplateElement] (Maybe [TemplateElement])
  - | For TemplateExpr [TemplateElement] (Maybe [TemplateElement])
  - | Partial TemplateExpr
  - | TrimL
  - | TrimR
- templateElems :: Parser [TemplateElement]
- readTemplateElems :: String -> [TemplateElement]
- readTemplateElemsFile :: FilePath -> String -> [TemplateElement]

# Documentation

newtype TemplateKey Source #

Constructors

TemplateKey String |

Instances

Eq TemplateKey Source # |
Methods (==) :: TemplateKey -> TemplateKey -> Bool # (/=) :: TemplateKey -> TemplateKey -> Bool #
Show TemplateKey Source # |
Methods showsPrec :: Int -> TemplateKey -> ShowS # show :: TemplateKey -> String # showList :: [TemplateKey] -> ShowS #
IsString TemplateKey Source # |
Methods fromString :: String -> TemplateKey #
Binary TemplateKey Source # |
Methods put :: TemplateKey -> Put # get :: Get TemplateKey # putList :: [TemplateKey] -> Put #

data TemplateExpr Source #

Expression in a template

Constructors

Ident TemplateKey |
Call TemplateKey [TemplateExpr] |
StringLiteral String |

Instances

Eq TemplateExpr Source # |
Methods (==) :: TemplateExpr -> TemplateExpr -> Bool # (/=) :: TemplateExpr -> TemplateExpr -> Bool #
Show TemplateExpr Source # |
Methods showsPrec :: Int -> TemplateExpr -> ShowS # show :: TemplateExpr -> String # showList :: [TemplateExpr] -> ShowS #
Binary TemplateExpr Source # |
Methods put :: TemplateExpr -> Put # get :: Get TemplateExpr # putList :: [TemplateExpr] -> Put #

data TemplateElement Source #

Elements of a template.

Constructors

Chunk String |
Expr TemplateExpr |
Escaped |
If TemplateExpr [TemplateElement] (Maybe [TemplateElement]) |
For TemplateExpr [TemplateElement] (Maybe [TemplateElement]) |
Partial TemplateExpr |
TrimL |
TrimR |

Instances

Eq TemplateElement Source # |
Methods (==) :: TemplateElement -> TemplateElement -> Bool # (/=) :: TemplateElement -> TemplateElement -> Bool #
Show TemplateElement Source # |
Methods showsPrec :: Int -> TemplateElement -> ShowS # show :: TemplateElement -> String # showList :: [TemplateElement] -> ShowS #
Binary TemplateElement Source # |
Methods put :: TemplateElement -> Put # get :: Get TemplateElement # putList :: [TemplateElement] -> Put #

templateElems :: Parser [TemplateElement] Source #

readTemplateElems :: String -> [TemplateElement] Source #

readTemplateElemsFile :: FilePath -> String -> [TemplateElement] Source #