Hakyll.Web.Template.Internal

hakyll-4.7.5.1: 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 |
Show Template |
IsString Template |
Binary Template |
Writable Template |

newtype TemplateKey

Constructors

TemplateKey String |

Instances

Eq TemplateKey |
Show TemplateKey |
IsString TemplateKey |
Binary TemplateKey |

data TemplateExpr

Expression in a template

Constructors

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

Instances

Eq TemplateExpr |
Show TemplateExpr |
Binary TemplateExpr |

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 |
Show TemplateElement |
Binary TemplateElement |

readTemplate :: String -> Template