Skip to content

Class FluidMarkdownGenerator

Namespace: Momentum.Extensions.EventMarkdownGenerator.Services
Assembly: Momentum.Extensions.EventMarkdownGenerator.dll

Generates markdown documentation from event metadata using Fluid (Liquid) templates. Supports custom template directories and generates both event and schema documentation.

csharp
public class FluidMarkdownGenerator

Inheritance

objectFluidMarkdownGenerator

Inherited Members

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Methods

CopyDefaultTemplatesToDirectoryAsync(string, CancellationToken)

Copies the default Liquid templates to a target directory for customization.

csharp
public static Task CopyDefaultTemplatesToDirectoryAsync(string targetDirectory, CancellationToken cancellationToken = default)

Parameters

targetDirectory string

The directory to copy templates to.

cancellationToken CancellationToken

Optional cancellation token.

Returns

Task

Exceptions

ArgumentException

Thrown when targetDirectory is null or empty.

CopyDefaultTemplatesToDirectoryAsync(string, CancellationToken)

csharp
public static Task CopyDefaultTemplatesToDirectoryAsync(string targetDirectory, CancellationToken cancellationToken = default)

Parameters

targetDirectory string

cancellationToken CancellationToken

Returns

Task

CreateAsync(string?)

Creates a new instance of the class asynchronously.

csharp
public static Task<FluidMarkdownGenerator> CreateAsync(string? customTemplatesDirectory = null)

Parameters

customTemplatesDirectory string?

Optional directory containing custom Liquid templates to override defaults.

Returns

Task<FluidMarkdownGenerator>

A new instance.

CreateAsync(string?)

csharp
public static Task<FluidMarkdownGenerator> CreateAsync(string? customTemplatesDirectory = null)

Parameters

customTemplatesDirectory string?

Returns

Task<FluidMarkdownGenerator>

GenerateAllMarkdown(IEnumerable<EventWithDocumentation>, string, GeneratorOptions?)

Generates markdown content for multiple events.

csharp
public IEnumerable<IndividualMarkdownOutput> GenerateAllMarkdown(IEnumerable<EventWithDocumentation> events, string outputDirectory, GeneratorOptions? options = null)

Parameters

events IEnumerable<EventWithDocumentation>

The events to render.

outputDirectory string

The base output directory for generated files.

options GeneratorOptions?

Optional generator options for customization.

Returns

IEnumerable<IndividualMarkdownOutput>

An enumerable of generated markdown outputs.

GenerateAllMarkdown(IEnumerable<EventWithDocumentation>, string, GeneratorOptions?)

csharp
public IEnumerable<IndividualMarkdownOutput> GenerateAllMarkdown(IEnumerable<EventWithDocumentation> events, string outputDirectory, GeneratorOptions? options = null)

Parameters

events IEnumerable<EventWithDocumentation>

outputDirectory string

options GeneratorOptions?

Returns

IEnumerable<IndividualMarkdownOutput>

GenerateAllSchemas(IEnumerable<Type>, string)

Generates markdown content for multiple complex type schemas.

csharp
public IEnumerable<IndividualMarkdownOutput> GenerateAllSchemas(IEnumerable<Type> schemaTypes, string outputDirectory)

Parameters

schemaTypes IEnumerable<Type>

The types to generate schema documentation for.

outputDirectory string

The base output directory for generated files.

Returns

IEnumerable<IndividualMarkdownOutput>

An enumerable of generated markdown outputs.

GenerateAllSchemas(IEnumerable<Type>, string)

csharp
public IEnumerable<IndividualMarkdownOutput> GenerateAllSchemas(IEnumerable<Type> schemaTypes, string outputDirectory)

Parameters

schemaTypes IEnumerable<Type>

outputDirectory string

Returns

IEnumerable<IndividualMarkdownOutput>

GenerateMarkdown(EventWithDocumentation, string, GeneratorOptions?)

Generates markdown content for a single event.

csharp
public IndividualMarkdownOutput GenerateMarkdown(EventWithDocumentation eventWithDoc, string outputDirectory, GeneratorOptions? options = null)

Parameters

eventWithDoc EventWithDocumentation

The event metadata and documentation to render.

outputDirectory string

The base output directory for generated files.

options GeneratorOptions?

Optional generator options for customization.

Returns

IndividualMarkdownOutput

The generated markdown output containing content and file path.

GenerateMarkdown(EventWithDocumentation, string, GeneratorOptions?)

csharp
public IndividualMarkdownOutput GenerateMarkdown(EventWithDocumentation eventWithDoc, string outputDirectory, GeneratorOptions? options = null)

Parameters

eventWithDoc EventWithDocumentation

outputDirectory string

options GeneratorOptions?

Returns

IndividualMarkdownOutput

GenerateSchemaMarkdown(Type, string)

Generates markdown content for a complex type schema.

csharp
public IndividualMarkdownOutput GenerateSchemaMarkdown(Type schemaType, string outputDirectory)

Parameters

schemaType Type

The type to generate schema documentation for.

outputDirectory string

The base output directory for generated files.

Returns

IndividualMarkdownOutput

The generated markdown output containing content and file path.

GenerateSchemaMarkdown(Type, string)

csharp
public IndividualMarkdownOutput GenerateSchemaMarkdown(Type schemaType, string outputDirectory)

Parameters

schemaType Type

outputDirectory string

Returns

IndividualMarkdownOutput