C# Class Microsoft.DocAsCode.Build.Engine.Template

Show file Open project: dotnet/docfx

Public Methods

Method Description
GetOptions ( object model ) : TransformModelOptions

exports.getOptions = function (model) { return { bookmarks : { uid1: "bookmark1" }, isShared: true } }

Template ( string name, DocumentBuildContext context, TemplateRendererResource templateResource, TemplatePreprocessorResource scriptResource, ResourceCollection resourceCollection, int maxParallelism ) : System
Transform ( object model ) : string

Transform from view model to the final result using template Supported template languages are mustache and liquid

TransformModel ( object model ) : object

Transform from raw model to view model TODO: refactor to merge model and attrs into one input model

Private Methods

Method Description
CreatePreprocessor ( ResourceCollection resourceCollection, TemplatePreprocessorResource scriptResource, DocumentBuildContext context ) : ITemplatePreprocessor
CreateRenderer ( ResourceCollection resourceCollection, TemplateRendererResource templateResource ) : ITemplateRenderer
ExtractDependentResources ( string templateName ) : IEnumerable

Dependent files are defined in following syntax in Mustache template leveraging Mustache Comments {{! include('file') }} file path can be wrapped by quote ' or double quote " or none

GetRelativeResourceKey ( string templateName, string relativePath ) : string
GetTemplateInfo ( string templateName ) : TemplateInfo

Method Details

GetOptions() public method

exports.getOptions = function (model) { return { bookmarks : { uid1: "bookmark1" }, isShared: true } }
public GetOptions ( object model ) : TransformModelOptions
model object
return TransformModelOptions

Template() public method

public Template ( string name, DocumentBuildContext context, TemplateRendererResource templateResource, TemplatePreprocessorResource scriptResource, ResourceCollection resourceCollection, int maxParallelism ) : System
name string
context DocumentBuildContext
templateResource TemplateRendererResource
scriptResource TemplatePreprocessorResource
resourceCollection ResourceCollection
maxParallelism int
return System

Transform() public method

Transform from view model to the final result using template Supported template languages are mustache and liquid
public Transform ( object model ) : string
model object The input view model
return string

TransformModel() public method

Transform from raw model to view model TODO: refactor to merge model and attrs into one input model
public TransformModel ( object model ) : object
model object The raw model
return object