This documentation is also published as Markdown for efficient machine reading: the whole site is indexed at /llms.txt, and every page has a clean Markdown copy under /_llms/. These are generated from the same source and cost far fewer tokens to read than this rendered HTML.

Skip to main content Skip to navigation

NavigationBuilder Pennington.Navigation

Builds hierarchical navigation trees and related navigation metadata from flat TOC entries.

Constructors

NavigationBuilder

#
public NavigationBuilder(FolderMetadataRegistry folderMetadata)

Creates a navigation builder that consults folderMetadata for folder-level title and order overrides discovered from _meta.yml sidecars.

Parameters

folderMetadata FolderMetadataRegistry

Methods

BuildNavigationInfoAsync

#
public Task<NavigationInfo> BuildNavigationInfoAsync(IReadOnlyList<ContentTocItem> items, UrlPath currentPath, string locale = null)

Build NavigationInfo for the page at currentPath within the tree. See BuildTreeAsync for snapshot-resolution semantics.

Parameters

items IReadOnlyList<ContentTocItem>
currentPath UrlPath
locale string

Returns

Task<NavigationInfo>

BuildTreeAsync

#
public Task<ImmutableList<NavigationTreeItem>> BuildTreeAsync(IReadOnlyList<ContentTocItem> items, UrlPath? currentPath = default, string locale = null)

Build a navigation tree from flat TOC items. Resolves the folder-metadata snapshot once via GetSnapshotAsync when configured; recursion stays sync once the snapshot is in hand. When locale is specified, filters to that locale and strips the locale prefix from hierarchy parts. When currentPath is specified, stamps IsSelected/IsExpanded along the path to that page.

Parameters

items IReadOnlyList<ContentTocItem>
currentPath UrlPath?
locale string

Returns

Task<ImmutableList<NavigationTreeItem>>

OnFileChanged

#
public FileWatchResponse OnFileChanged(FileChangeNotification change)

Called on the file-watcher thread for every watched change. Must be quick and thread-safe.

Parameters

change FileChangeNotification

Returns

FileWatchResponse

Pennington.Navigation.NavigationBuilder

namespace Pennington.Navigation;

/// Builds hierarchical navigation trees and related navigation metadata from flat TOC entries.
public class NavigationBuilder
{
    /// Build NavigationInfo for the page at currentPath within the tree. See BuildTreeAsync for snapshot-resolution semantics.
    
public Task<NavigationInfo> BuildNavigationInfoAsync(IReadOnlyList<ContentTocItem> items, UrlPath currentPath, string locale = null)
; /// Build a navigation tree from flat TOC items. Resolves the folder-metadata snapshot once via GetSnapshotAsync when configured; recursion stays sync once the snapshot is in hand. When locale is specified, filters to that locale and strips the locale prefix from hierarchy parts. When currentPath is specified, stamps IsSelected/IsExpanded along the path to that page.
public Task<ImmutableList<NavigationTreeItem>> BuildTreeAsync(IReadOnlyList<ContentTocItem> items, UrlPath? currentPath = default, string locale = null)
; /// Creates a navigation builder that consults folderMetadata for folder-level title and order overrides discovered from _meta.yml sidecars.
public NavigationBuilder(FolderMetadataRegistry folderMetadata)
; /// Called on the file-watcher thread for every watched change. Must be quick and thread-safe.
public FileWatchResponse OnFileChanged(FileChangeNotification change)
; }