RazorDocs Search

ViewComponents

Type

SidebarViewComponent

A view component that renders the sidebar navigation for documentation pages. Groups documents by their directory structure for organized navigation.

Method

InvokeAsync

Task<IViewComponentResult> InvokeAsync()

Retrieves all documentation nodes and groups them by directory for sidebar display.

Returns

A view result containing documentation nodes grouped by their parent directory, ordered alphabetically by directory name.

Remarks

Documents without a directory path are grouped under "General".

Method

GetGroupName

string GetGroupName(string path)

Determines a display group name for a given documentation path.

Parameters

  • pathThe relative documentation path.

Returns

A string representing the group (e.g., "Namespaces", "General", or a directory name).

Method

GetDerivedNamespacePrefixes

string[] GetDerivedNamespacePrefixes(IEnumerable<DocNode> docs)

Automatically derives common namespace prefixes from the set of harvested documentation nodes to simplify sidebar display.

Parameters

  • docsThe collection of documentation nodes to analyze.

Returns

An array of strings representing common namespace prefixes encountered.