Skip to content

Framework

LeafKit

Leaf is a templating language for generating dynamic content such as HTML using a simple syntax.

Overview

LeafKit is the main templating language for Vapor.

For more details, check out the docs.

Topics

Classes

Protocols

  • LeafCache
    LeafCache provides blind storage for compiled LeafAST objects.
  • LeafDataRepresentable
    Capable of being encoded as LeafData.
  • LeafSource
    Public protocol to adhere to in order to provide template source originators to LeafRenderer
  • LeafTag
    Create custom tags by conforming to this protocol and registering them.
  • UnsafeUnescapedLeafTag
    Tags conforming to this protocol do not get their contents HTML-escaped.

Structures

  • LeafAST
    LeafAST represents a “compiled,” grammatically valid Leaf template (which may or may not be fully resolvable or erroring)
  • LeafConfiguration
    General configuration of Leaf
  • LeafContext
  • LeafData
    LeafData is a “pseudo-protocol” wrapping the physically storable Swift data types Leaf can use directly
  • LeafError
    LeafError reports errors during the template rendering process, wrapping more specific errors if necessary during Lexing and Parsing stages.
  • LexerError
    LexerError reports errors during the lexing stage.
  • NIOLeafFiles
    Reference and default implementation of LeafSource adhering object that provides a non-blocking file reader for LeafRenderer

Variables

Enumerations

  • ConditionalSyntax
  • Constant
    An integer or double constant value parameter (eg 1_000, -42.0)
  • LeafKeyword
    Keywords are identifiers which take precedence over syntax/variable names - may potentially have representable state themselves as value when used with operators (eg, true, false when used with logical operators, nil when used with equality operators, and so forth)
  • LeafOperator
    Mathematical and Logical operators
  • Parameter
    An associated value enum holding data, objects or values usable as parameters to a .tag
  • ParameterDeclaration
  • Syntax

Extended Modules