Commit 42e5679
Add full navigation section type support (Tabs, Anchors, Dropdowns, Products) (#49)
* Add full navigation section type support to ParseNavigationConfig
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>
* Bump SDK version to 1.3.0, fix EasyAF.MSBuild version constraint, move 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>
* Skip auto-navigation population when template defines explicit sections
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>
* Add renderer-level tests for explicit template navigation sections
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>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent ed356a3 commit 42e5679
2 files changed
Lines changed: 203 additions & 9 deletions
File tree
- src
- CloudNimble.DotNetDocs.Mintlify
- CloudNimble.DotNetDocs.Tests.Mintlify/Renderers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
147 | 160 | | |
148 | 161 | | |
149 | 162 | | |
| |||
Lines changed: 182 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
42 | 49 | | |
43 | 50 | | |
44 | 51 | | |
| |||
59 | 66 | | |
60 | 67 | | |
61 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
62 | 73 | | |
63 | 74 | | |
64 | 75 | | |
| |||
333 | 344 | | |
334 | 345 | | |
335 | 346 | | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
336 | 517 | | |
337 | 518 | | |
338 | 519 | | |
0 commit comments