Add full navigation section type support (Tabs, Anchors, Dropdowns, Products)#49
Merged
robertmclaws merged 4 commits intomainfrom Feb 28, 2026
Merged
Add full navigation section type support (Tabs, Anchors, Dropdowns, Products)#49robertmclaws merged 4 commits intomainfrom
robertmclaws merged 4 commits intomainfrom
Conversation
ParseNavigationConfig previously only handled Pages-based navigation, always initializing an empty Pages list even when unused. This adds support for all four remaining Mintlify navigation section types: Tabs, Anchors, Dropdowns, and Products. Changes: - Rework ParseNavigationConfig to detect and populate Tabs, Anchors, Dropdowns, and Products from their XML wrapper elements; Pages initialization is now deferred and only set when explicitly present - Add ParseTabConfig, ParseAnchorConfig, ParseDropdownConfig, and ParseProductConfig internal methods with full XML attribute and nested-element parsing - Add ParseNavigationSectionPages private helper to share Groups/Page parsing logic across all section types - Add 20 new tests covering all parse methods, HTML entity decoding, nested structures, multi-type coexistence, and backward compatibility Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e specs to future - Bump DotNetDocs.Sdk reference from 1.2.0 to 1.3.0 in both .docsproj files - Change EasyAF.MSBuild version constraint from 4.*-* to 4.* to resolve NU1107 conflict - Delete specs/semantic-kernel-integration.md and specs/try-dotnet.md (moved to specs/future/) - Add specs/future/ with moved specs and contributors.md Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When a MintlifyTemplate specifies Tabs, Anchors, Dropdowns, or Products directly in the <Navigation> XML, the renderer was still calling PopulateNavigationFromPath which unconditionally initialized Pages and auto-discovered MDX files from disk. This produced a spurious "navigation.pages" block alongside the explicit "navigation.tabs" in the output docs.json. Fix by checking for explicit navigation sections after loading the template config and skipping both PopulateNavigationFromPath and BuildNavigationStructure when they are present. The NavigationType-based auto-generation path (where Pages are discovered then moved to a Tab by ApplyNavigationType) is unaffected. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The parser-layer tests (ParseNavigationConfig_WithTabsElement_PopulatesTabsNotPages etc.) already verified that Pages comes back null when only Tabs are defined in XML. However, the actual bug was one layer deeper — in MintlifyRenderer.ProcessAsync, which called PopulateNavigationFromPath and injected a spurious pages block regardless. This adds: - contentOnly parameter to ConfigureTestWithTemplate so tests can invoke ProcessAsync([]) (documentation-only mode) with HasMintlifyTemplate set - ExplicitTemplateTabs_ContentOnly_HasTabsAndNoPages - ExplicitTemplateTabs_WithAssembly_HasOnlyTabsAndNoPages (regression) - ExplicitTemplateAnchors_ContentOnly_HasAnchorsAndNoPages - ExplicitTemplateProducts_ContentOnly_HasProductsAndNoPages Each test asserts that Navigation.Pages is null in the deserialized docs.json when the template defines an explicit navigation section type, which is the behavior introduced by the MintlifyRenderer fix. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
<MintlifyTemplate>XML —ParseNavigationConfigpreviously only handled<Pages>; Tabs, Anchors, Dropdowns, and Products were silently ignoredParseTabConfig,ParseAnchorConfig,ParseDropdownConfig,ParseProductConfiginternal methods with full attribute and nested-element support (Tabs-within-Anchors, Tabs+Anchors-within-Dropdowns, etc.)ParseNavigationSectionPagesprivate helper to share<Groups>/<Group>and<Page>parsing logic across all section typesnavigation.pagesoutput when template uses explicit sections —MintlifyRendererwas still callingPopulateNavigationFromPathandBuildNavigationStructureeven when the template fully specified navigation via Tabs/Anchors/Dropdowns/Products, producing a broken docs.json with bothpagesandtabsblocksGenerateDocumentationTaskTests.cscovering all newParse*Configmethods, HTML entity decoding, nested structures, multi-type coexistence, and backward-compatible Pages behaviorMintlifyRendererNavigationTypeTests.csthat exercise the fullProcessAsync→RenderAsync→DocsJsonManager.Saveround-trip and assertNavigation.Pagesis null — including a regression test with a real assembly presentDotNetDocs.Sdkreference from1.2.0to1.3.0in both.docsprojfilesEasyAF.MSBuildversion constraint from4.*-*to4.*to resolve pre-existing NU1107 dependency conflictsemantic-kernel-integration.mdandtry-dotnet.mdintospecs/future/Test plan
ParseGroupConfig,ApplyNavigationType, and navigation tests continue to pass (318 SDK Tasks + 249 Mintlify = 567 total, 0 failures)ParseTabConfig_WithHtmlEncodedName_DecodesCorrectly—S&Sdecoded toS&SParseTabConfig_WithNestedGroups_ParsesHierarchy— nested GroupConfig within TabParseAnchorConfig_WithNestedTabs_ParsesTabs— Tabs nested within AnchorParseDropdownConfig_WithNestedTabsAndAnchors_ParsesBoth— Tabs + Anchors within DropdownParseNavigationConfig_WithTabsElement_PopulatesTabsNotPages— Pages remains null when Tabs usedParseNavigationConfig_WithTabsElement_PreservesTabOrder— 5-tab order preserved including&entitiesParseNavigationConfig_WithPagesElement_StillWorks— backward compatibility maintainedExplicitTemplateTabs_ContentOnly_HasTabsAndNoPages— content-only mode produces no spurious pages blockExplicitTemplateTabs_WithAssembly_HasOnlyTabsAndNoPages— regression: assembly present does not inject pagesExplicitTemplateAnchors_ContentOnly_HasAnchorsAndNoPagesExplicitTemplateProducts_ContentOnly_HasProductsAndNoPages🤖 Generated with Claude Code