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
DefaultLeafCacheLeafRendererLeafRendererimplements the full Leaf language pipeline.LeafSourcesAn opaque object holding namedLeafSourceadherants specifying a default search order.
Protocols
LeafCacheLeafCacheprovides blind storage for compiledLeafASTobjects.LeafDataRepresentableCapable of being encoded asLeafData.LeafSourcePublic protocol to adhere to in order to provide template source originators toLeafRendererLeafTagCreate custom tags by conforming to this protocol and registering them.UnsafeUnescapedLeafTagTags conforming to this protocol do not get their contents HTML-escaped.
Structures
LeafASTLeafASTrepresents a “compiled,” grammatically valid Leaf template (which may or may not be fully resolvable or erroring)LeafConfigurationGeneral configuration of LeafLeafContextLeafDataLeafDatais a “pseudo-protocol” wrapping the physically storable Swift data types Leaf can use directlyLeafErrorLeafErrorreports errors during the template rendering process, wrapping more specific errors if necessary during Lexing and Parsing stages.LexerErrorLexerErrorreports errors during the lexing stage.NIOLeafFilesReference and default implementation ofLeafSourceadhering object that provides a non-blocking file reader forLeafRenderer
Variables
Enumerations
ConditionalSyntaxConstantAn integer or double constant value parameter (eg1_000,-42.0)LeafKeywordKeywords are identifiers which take precedence over syntax/variable names - may potentially have representable state themselves as value when used with operators (eg,true,falsewhen used with logical operators,nilwhen used with equality operators, and so forth)LeafOperatorMathematical and Logical operatorsParameterAn associated value enum holding data, objects or values usable as parameters to a.tagParameterDeclarationSyntax