Skip to main content

Class TemplateLoader

Namespace: DocFxToTemplate.Templates
Assembly: DocFxToTemplate.dll
Source: src/DocFxToTemplate/Templates/TemplateLoader.cs#L7

src/DocFxToTemplate/Templates/TemplateLoader.cs#L7
public class TemplateLoader : ITemplateLoader

Inheritance:
object <- TemplateLoader

Inherited Members:
object.Equals(object, object), object.Equals(object), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object, object), object.ToString()

Implements:
Scriban.Runtime.ITemplateLoader

Methods

GetPath(TemplateContext, SourceSpan, string)

Gets an absolute path for the specified include template name. Note that it is not necessarely a path on a disk, but an absolute path that can be used as a dictionary key for caching)

src/DocFxToTemplate/Templates/TemplateLoader.cs#L11
public string GetPath(TemplateContext context, SourceSpan callerSpan, string templateName)

Parameters

context TemplateContext
The current context called from
callerSpan SourceSpan
The current span called from
templateName string
The name of the template to load

Returns

string
An absolute path or unique key for the specified template name

Load(TemplateContext, SourceSpan, string)

Loads a template using the specified template path/key.

src/DocFxToTemplate/Templates/TemplateLoader.cs#L16
public string Load(TemplateContext context, SourceSpan callerSpan, string templatePath)

Parameters

context TemplateContext
The current context called from
callerSpan SourceSpan
The current span called from
templatePath string
The path/key previously returned by

Returns

string
The content string loaded from the specified template path/key

LoadAsync(TemplateContext, SourceSpan, string)

Loads a template using the specified template path/key.

src/DocFxToTemplate/Templates/TemplateLoader.cs#L21
public ValueTask<string> LoadAsync(TemplateContext context, SourceSpan callerSpan, string templatePath)

Parameters

context TemplateContext
The current context called from
callerSpan SourceSpan
The current span called from
templatePath string
The path/key previously returned by

Returns

ValueTask<string>
The content string loaded from the specified template path/key

Implements

  • Scriban.Runtime.ITemplateLoader