FileTemplateLoader
public class FileTemplateLoaderNo description is available for this type.
Properties
Section titled “Properties”
public string Root { get; }The root directory from which templates will be resolved if a caller file is not provided.
Returns
System.String — No return description is available.
Constructors
Section titled “Constructors”
FileTemplateLoader(string)
Section titled “FileTemplateLoader(string)”public FileTemplateLoader(string root)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
root |
System.String |
Methods
Section titled “Methods”
GetPath(TemplateContext, SourceSpan, string)
Section titled “GetPath(TemplateContext, SourceSpan, string)”public string GetPath(TemplateContext context, SourceSpan callerSpan, string templateName)Given the template context, the caller’s source span, and the template name (e.g. from an include), return the full path to the template file.
Parameters
| Name | Type | Description |
|---|---|---|
context |
Scriban.TemplateContext | The current template context. |
callerSpan |
Scriban.Parsing.SourceSpan | The source span of the calling template (may contain a FileName). |
templateName |
System.String | The name of the template to load. |
Returns
System.String — The full file system path to the template.
Load(TemplateContext, SourceSpan, string)
Section titled “Load(TemplateContext, SourceSpan, string)”public string Load(TemplateContext context, SourceSpan callerSpan, string templatePath)Synchronously loads the template content from the specified path.
Parameters
| Name | Type | Description |
|---|---|---|
context |
Scriban.TemplateContext | The current template context. |
callerSpan |
Scriban.Parsing.SourceSpan | The source span of the calling template. |
templatePath |
System.String | The full path to the template file. |
Returns
System.String — The contents of the template file as a string.
LoadAsync(TemplateContext, SourceSpan, string)
Section titled “LoadAsync(TemplateContext, SourceSpan, string)”public ValueTask<string> LoadAsync(TemplateContext context, SourceSpan callerSpan, string templatePath)Asynchronously loads the template content from the specified path.
Parameters
| Name | Type | Description |
|---|---|---|
context |
Scriban.TemplateContext | The current template context. |
callerSpan |
Scriban.Parsing.SourceSpan | The source span of the calling template. |
templatePath |
System.String | The full path to the template file. |
Returns
System.Threading.Tasks.ValueTask{System.String} — A ValueTask containing the template content as a string.