C# Class Mustachio.Parser

The main entry point for this library. Use the static "Parse" methods to create template functions. Functions are safe for reuse, so you may parse and cache the resulting function.
Afficher le fichier Open project: wildbit/mustachio

Méthodes publiques

Méthode Description
Parse ( string template, bool disableContentEscaping = false ) : Func,String>

Parse the template content, producing a function that can be used to apply variables to the template. The provided function can be reused (i.e. no state will "leak" from one application of the function to the next).

ParseWithModelInference ( string templateSource, bool disableContentEscaping = false ) : ExtendedParseInformation

Parse the template, and capture paths used in the template to determine a suitable structure for the required model.

Private Methods

Méthode Description
HandleCollectionOpen ( TokenPair token, Queue remainder, ParsingOptions options, InferredTemplateModel scope ) : ContextObject>.Action
HandleContent ( string token ) : ContextObject>.Action
HandleElementOpen ( TokenPair token, Queue remainder, ParsingOptions options, InferredTemplateModel scope ) : ContextObject>.Action
HandleInvertedElementOpen ( TokenPair token, Queue remainder, ParsingOptions options, InferredTemplateModel scope ) : ContextObject>.Action
HandleSingleValue ( TokenPair token, ParsingOptions options, InferredTemplateModel scope ) : ContextObject>.Action
HtmlEncodeString ( string context ) : string
Parse ( Queue tokens, ParsingOptions options, InferredTemplateModel currentScope = null ) : ContextObject>.Action

Method Details

Parse() public static méthode

Parse the template content, producing a function that can be used to apply variables to the template. The provided function can be reused (i.e. no state will "leak" from one application of the function to the next).
public static Parse ( string template, bool disableContentEscaping = false ) : Func,String>
template string The content of the template to be parsed.
disableContentEscaping bool In some cases, content should not be escaped (such as when rendering text bodies and subjects in emails). /// By default, we use content escaping, but this parameter allows it to be disabled.
Résultat Func,String>

ParseWithModelInference() public static méthode

Parse the template, and capture paths used in the template to determine a suitable structure for the required model.
public static ParseWithModelInference ( string templateSource, bool disableContentEscaping = false ) : ExtendedParseInformation
templateSource string The template content to parse.
disableContentEscaping bool In some cases, content should not be escaped (such as when rendering text bodies and subjects in emails). /// By default, we use content escaping, but this parameter allows it to be disabled.
Résultat ExtendedParseInformation