C# Class Scriban.Template

Entry point class to parse templates and render them.
Afficher le fichier Open project: lunet-io/scriban Class Usage Examples

Méthodes publiques

Méthode Description
Parse ( string text, string sourceFilePath = null, ParserOptions options = null ) : Template

Parses the specified scripting text into a Template .

Render ( object model = null ) : string

Renders this template using the specified object model.

Render ( TemplateContext context ) : void

Renders this template using the specified context. See remarks.

When using this method, the result of rendering this page is output to TemplateContext.Output

Private Methods

Méthode Description
ParseInternal ( string text, string sourceFilePath ) : void
Template ( ParserOptions options, string sourceFilePath ) : System

Method Details

Parse() public static méthode

Parses the specified scripting text into a Template .
public static Parse ( string text, string sourceFilePath = null, ParserOptions options = null ) : Template
text string The scripting text.
sourceFilePath string The source file path. Optional, used for better error reporting if the source file has a location on the disk
options Scriban.Parsing.ParserOptions The templating parsing options.
Résultat Template

Render() public méthode

Renders this template using the specified object model.
public Render ( object model = null ) : string
model object The object model.
Résultat string

Render() public méthode

Renders this template using the specified context. See remarks.
When using this method, the result of rendering this page is output to TemplateContext.Output
If context is null If the template . Check the property for more details
public Render ( TemplateContext context ) : void
context TemplateContext The template context.
Résultat void