Hakyll.Web.Template.Internal

hakyll-4.8.3.2: A static website compiler library

Safe Haskell | None
Language | Haskell98

Hakyll.Web.Template.Internal

Description

Module containing the template data structure

Synopsis

- newtype Template = Template {
  - unTemplate :: [TemplateElement]
  }
- newtype TemplateKey = TemplateKey String
- data TemplateExpr
  - = Ident TemplateKey
  - | Call TemplateKey [TemplateExpr]
  - | StringLiteral String
- data TemplateElement
  - = Chunk String
  - | Expr TemplateExpr
  - | Escaped
  - | If TemplateExpr Template (Maybe Template)
  - | For TemplateExpr Template (Maybe Template)
  - | Partial TemplateExpr
- readTemplate :: String -> Template

# Documentation

newtype Template #

Datatype used for template substitutions.

Constructors

Template |
Fields unTemplate :: [TemplateElement]

Instances

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

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 Template (Maybe Template) |
For TemplateExpr Template (Maybe Template) |
Partial TemplateExpr |

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 #

readTemplate :: String -> Template #