Skip to content

IRenderer and IDocumentCompiler

JP edited this page May 2, 2021 · 1 revision

When parsing a template Morestachio returns an instance of IRenderer. The renderer is responsable for rendering the DocumentTree with your Data object and should allows to intercept certain specific rendering logic. Morestachio has two renderer: Morestachio.Rendering.Renderer and Morestachio.Rendering.CompiledRenderer. The former acts as an replacement for the old call of MorestachioDocumentInfo.CreateAsync and will utilize the document tree directly, the later will first compile the DocumentTree into an in-memory delegate and then executes the template. As both inherts from IRenderer it allows your application to be agnostic about the specific execution method.