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 #

Constructors

TemplateKey String |

Instances

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

data TemplateExpr #

Expression in a template

Constructors

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

Instances

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

data TemplateElement #

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 # |
Methods (==) :: TemplateElement -> TemplateElement -> Bool # (/=) :: TemplateElement -> TemplateElement -> Bool #
Show TemplateElement # |
Methods showsPrec :: Int -> TemplateElement -> ShowS # show :: TemplateElement -> String # showList :: [TemplateElement] -> ShowS #
Binary TemplateElement # |
Methods put :: TemplateElement -> Put # get :: Get TemplateElement # putList :: [TemplateElement] -> Put #

templateElems :: Parser [TemplateElement] #

readTemplateElems :: String -> [TemplateElement] #

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