Skip to content

Class JsonSidebarGenerator ​

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

Generates JSON sidebar navigation structure for documentation sites. Groups events by subdomain and section, with separate schemas section.

csharp
public static class JsonSidebarGenerator

Inheritance ​

object ← JsonSidebarGenerator

Inherited Members ​

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

Methods ​

GenerateSidebar(ICollection<EventWithDocumentation>) ​

Generates a JSON string containing the sidebar navigation structure.

csharp
public static string GenerateSidebar(ICollection<EventWithDocumentation> events)

Parameters ​

events ICollection<EventWithDocumentation>

The events to include in the sidebar.

Returns ​

string

A formatted JSON string representing the sidebar structure.

GenerateSidebarItems(ICollection<EventWithDocumentation>) ​

csharp
public static List<SidebarItem> GenerateSidebarItems(ICollection<EventWithDocumentation> events)

Parameters ​

events ICollection<EventWithDocumentation>

Returns ​

List<SidebarItem>

WriteSidebarAsync(ICollection<EventWithDocumentation>, string, CancellationToken) ​

Generates and writes the sidebar JSON to a file asynchronously.

csharp
public static Task WriteSidebarAsync(ICollection<EventWithDocumentation> events, string filePath, CancellationToken cancellationToken = default)

Parameters ​

events ICollection<EventWithDocumentation>

The events to include in the sidebar.

filePath string

The file path to write the sidebar JSON to.

cancellationToken CancellationToken

Optional cancellation token.

Returns ​

Task