LeafKit Documentation

Classes

Default​Leaf​Cache
Leaf​Renderer

LeafRenderer implements the full Leaf language pipeline.

Leaf​Sources

An opaque object holding named LeafSource adherants specifying a default search order.

Structures

Leaf​AST

LeafAST represents a "compiled," grammatically valid Leaf template (which may or may not be fully resolvable or erroring)

Leaf​Configuration

General configuration of Leaf

Leaf​Data

LeafData is a "pseudo-protocol" wrapping the physically storable Swift data types Leaf can use directly

Leaf​Error

LeafError reports errors during the template rendering process, wrapping more specific errors if necessary during Lexing and Parsing stages.

Lexer​Error

LexerError reports errors during the stage.

Leaf​Context
NIOLeaf​Files

Reference and default implementation of LeafSource adhering object that provides a non-blocking file reader for LeafRenderer

NIOLeaf​Files.​Limit

Various options for configuring an instance of NIOLeafFiles

Syntax.​Import
Syntax.​Extend
Syntax.​Export
Syntax.​Conditional
Syntax.​With
Syntax.​Loop
Syntax.​Custom​Tag​Declaration

Enumerations

Leaf​Data.​Natural​Type

The concrete instantiable object types for a LeafData

Leaf​Error.​Reason

Possible cases of a LeafError.Reason, with applicable stored values where useful for the type

Lexer​Error.​Reason
Parameter

An associated value enum holding data, objects or values usable as parameters to a .tag

Leaf​Keyword

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)

Leaf​Operator

Mathematical and Logical operators

Constant

An integer or double constant value parameter (eg 1_000, -42.0)

Parameter​Declaration
Syntax
Conditional​Syntax

Protocols

Leaf​Cache

LeafCache provides blind storage for compiled LeafAST objects.

Leaf​Data​Representable

Capable of being encoded as LeafData.

Leaf​Source

Public protocol to adhere to in order to provide template source originators to LeafRenderer

Leaf​Tag

Create custom tags by conforming to this protocol and registering them.

Unsafe​Unescaped​Leaf​Tag

Tags conforming to this protocol do not get their contents HTML-escaped.

Variables

default​Tags

Extensions

Array
BinaryFloatingPoint
Bool
Date
Dictionary
FixedWidthInteger
Set
String
UUID