Skip to content

Installation

Trais McAllister edited this page Sep 3, 2024 · 3 revisions

Installation

To use MtconnectTranspiler.CodeGenerators.ScribanTemplates in your project, follow these steps.

Prerequisites

  • .NET Core 3.1 or higher
  • Visual Studio or a compatible IDE

Installation via NuGet

  1. Open your project in Visual Studio.
  2. Right-click on your project and select "Manage NuGet Packages."
  3. Search for MtconnectTranspiler.CodeGenerators.ScribanTemplates.
  4. Click "Install."

Alternatively, you can install the package via the NuGet CLI:

dotnet add package MtconnectTranspiler.CodeGenerators.ScribanTemplates

Adding Services to Dependency Injection

In your Startup.cs or Program.cs, add the Scriban services:

services.AddScribanServices(builder =>
{
    builder
        .UseTemplatesPath("path/to/templates")
        .UseResourceAssembly(typeof(YourProjectClass).Assembly, "YourProjectNamespace.EmbeddedTemplates")
        .AddMarkdownInterpreter("custom", new CustomMarkdownInterpreter())
        .AddCodeFormatter("csharp", new CSharpCodeFormatter());
});

Next, you're ready to start using the template generation system.

Clone this wiki locally