Skip to content

Commit b6946de

Browse files
committed
List implementations of INavigationItem and throw exception
1 parent 50b364a commit b6946de

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/tooling/docs-assembler/Navigation/LlmsNavigationEnhancer.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,18 @@ FileNavigationItem fileItem when fileItem.Model is MarkdownFile markdownFile
123123
DocumentationGroup group when group.Index is MarkdownFile indexFile
124124
=> indexFile.YamlFrontMatter?.Description,
125125

126-
_ => null
126+
// For table of contents trees (inherits from DocumentationGroup, but handled explicitly)
127+
TableOfContentsTree tocTree when tocTree.Index is MarkdownFile indexFile
128+
=> indexFile.YamlFrontMatter?.Description,
129+
130+
// Cross-repository links don't have descriptions in frontmatter
131+
CrossLinkNavigationItem => null,
132+
133+
// API-related navigation items (these don't have markdown frontmatter)
134+
// Check by namespace to avoid direct assembly references
135+
INavigationItem item when item.GetType().FullName?.StartsWith("Elastic.ApiExplorer.", StringComparison.Ordinal) == true => null,
136+
137+
// Throw exception for any unhandled navigation item types
138+
_ => throw new InvalidOperationException($"Unhandled navigation item type: {navigationItem.GetType().FullName}")
127139
};
128140
}

0 commit comments

Comments
 (0)