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 ​

object ← FluidMarkdownGenerator

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.

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.

GenerateAllMarkdown(IEnumerable<EventWithDocumentation>, string, GeneratorOptions?, IReadOnlySet<Type>?) ​

Generates markdown content for multiple events.

csharp
public IEnumerable<IndividualMarkdownOutput> GenerateAllMarkdown(IEnumerable<EventWithDocumentation> events, string outputDirectory, GeneratorOptions? options = null, IReadOnlySet<Type>? schemaTypes = 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.

schemaTypes IReadOnlySet<Type>?

Types with generated schema documentation, used to link event.Entity to its schema page when the entity type is among them.

Returns ​

IEnumerable<IndividualMarkdownOutput>

An enumerable of generated markdown outputs.

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.

GenerateMarkdown(EventWithDocumentation, string, GeneratorOptions?, IReadOnlySet<Type>?) ​

Generates markdown content for a single event.

csharp
public IndividualMarkdownOutput GenerateMarkdown(EventWithDocumentation eventWithDoc, string outputDirectory, GeneratorOptions? options = null, IReadOnlySet<Type>? schemaTypes = 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.

schemaTypes IReadOnlySet<Type>?

Types with generated schema documentation, used to link event.Entity to its schema page when the entity type is among them.

Returns ​

IndividualMarkdownOutput

The generated markdown output containing content and file path.

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.