DocsJsonManager from Mintlify.Core to intelligently merge multiple
navigation sources without duplication.
Overview
Navigation generation happens in three distinct phases:1
Load Template Navigation
If a 
MintlifyTemplate is defined in the .docsproj file, it’s loaded first as the foundation for navigation structure.2
Discover Conceptual Docs
The system scans the documentation root folder for existing 
.mdx files, automatically organizing them into navigation groups while preserving template structure.3
Add API Reference
Generated API documentation is added to the navigation, organized either as a unified structure or by assembly depending on 
NavigationMode.Phase 1: Template Navigation
The.docsproj file can define a MintlifyTemplate that provides the baseline documentation structure. This template becomes the foundation that all other navigation is merged into.
Template Structure
CloudNimble.DotNetDocs.Docs.docsproj
Template Loading Process
When the MintlifyRenderer starts, it checks if a template is provided:- Load or Create Default: If 
_options.Templateexists, load it; otherwise create a default configuration - Initialize DocsJsonManager: Pass the template config to 
DocsJsonManager.Load(DocsJsonConfig) - Track Known Paths: All paths in the template are added to 
_knownPagePathsfor duplicate detection 
MintlifyRenderer.cs:82-94
The template provides the structure and styling (theme, colors, logos) that remains constant, while navigation gets intelligently merged from multiple sources.
Phase 2: Folder Scanning
After loading the template, the system scans the documentation root directory for existing.mdx files using PopulateNavigationFromPath.
Scanning Behavior
Excluded Directories The scanner automatically excludes certain directories:- Directories starting with 
.(hidden directories) node_modules(package dependencies)conceptual(reserved for overrides)overrides(reserved for customization)api-reference(handled separately in Phase 3)
.mdx files are included in navigation:
.mdxfiles: Added to navigation automatically.mdfiles: Generate warnings and are excluded- Other files: Ignored completely
 
index.mdx are prioritized and appear first in their group.
Navigation Overrides
Any directory can include a navigation.json file for complete control:
guides/navigation.json
navigation.json is found, the system:
- Stops automatic navigation generation for that directory tree
 - Uses the custom 
GroupConfigobject as-is - Tracks all paths in the custom navigation
 
preserveExisting: true parameter ensures template navigation is preserved:
- Existing template groups remain in their original position
 - Discovered content is merged into matching groups by name
 - New groups are appended after template groups
 - Duplicate paths are detected and skipped using 
_knownPagePaths 
Folder Scanning Code
MintlifyRenderer.cs:124
Set 
preserveExisting: false to replace template navigation entirely with discovered structure. This is useful for fully automated documentation sites.Phase 3: API Reference Generation
The final phase adds generated API documentation to the navigation structure. The organization depends on theNavigationMode setting.
Navigation Modes
- Unified Mode (Default)
 - ByAssembly Mode
 
Creates a single “API Reference” group with hierarchical namespace organization:Best for: Single-project solutions where all APIs logically belong together
API Reference Code Flow
MintlifyRenderer.cs:127
BuildNavigationStructure method:
- Finds or creates the API Reference group using 
FindOrCreateApiReferenceGroup - Iterates through all namespaces in the documentation model
 - Creates nested groups for namespace hierarchy (e.g., 
CloudNimble�DotNetDocs�Core) - Adds page paths for each type using 
_docsJsonManager.AddPage() - Respects the 
_knownPagePathshashset to avoid duplicates 
DocsJsonManager Deep Dive
TheDocsJsonManager from Mintlify.Core is the engine that powers intelligent navigation merging.
Key Features
Duplicate Detection
The 
_knownPagePaths HashSet tracks every path added to navigation, preventing duplicates across template, discovered, and generated content.Smart Group Merging
Groups with matching names are automatically merged. Pages from multiple sources combine into a single cohesive group.
Hierarchical Path Tracking
The 
AddPage(string groupPath, string pagePath) method supports slash-separated paths like “Getting Started/API Reference” for nested groups.Validation & Cleanup
Automatically removes groups with null names that would cause Mintlify to reject the configuration.
Core Methods
Load(DocsJsonConfig) Loads a configuration object and populates_knownPagePaths by recursively scanning all navigation:
DocsJsonManager.cs:159-172
.mdx files and builds navigation structure:
DocsJsonManager.cs:444-483
path: Root directory to scanfileExtensions: Array of extensions (default:[".mdx"])includeApiReference: Whether to scanapi-referencefolder (default:false)preserveExisting: Merge with existing navigation vs replace (default:true)allowDuplicatePaths: Whether to allow duplicate page paths (default:false)
DocsJsonManager.cs:493-512
true if page was added, false if it was a duplicate and skipped.
MergeNavigation
Intelligently merges two navigation structures:
DocsJsonManager.cs:890-943
- Pages: Deduplicated using 
_knownPagePaths - Groups: Merged by name, combining pages recursively
 - Tabs: Merged by name or href
 - Anchors: Appended to target
 
DocsJsonManager.cs:591-611
Configuration Examples
Unified Navigation with Template
ByAssembly Navigation
Custom Navigation Override
Createguides/navigation.json in your documentation folder:
guides directory.
Best Practices
Use Templates for Structure
Define your site structure (Getting Started, Guides, etc.) in the 
.docsproj template. Let folder scanning fill in the content.Organize by Concern
Create directories that match your template groups. Files in 
guides/ will merge into the “Guides” group automatically.Override When Needed
Use 
navigation.json for complex sections where automatic discovery doesn’t match your desired structure.Name Files Descriptively
File names become URLs. Use 
kebab-case.mdx for clean, readable paths like /guides/getting-started.Keep API Reference Separate
Never manually create files in 
api-reference/. This folder is fully managed by the generator and will be overwritten.Test Incremental Builds
The duplicate detection system preserves navigation across multiple builds. Test that your structure remains stable.
Troubleshooting
Duplicate Pages in Navigation Symptom: Same page appears multiple times in navigation Cause:allowDuplicatePaths is enabled or paths are tracked incorrectly
Solution:
- Ensure 
allowDuplicatePaths: falsein your .docsproj - Check that template paths match discovered paths exactly (case-insensitive)
 - Review 
navigation.jsonfiles for duplicate references 
.mdx files exist but don’t appear in navigation
Cause: Files are in excluded directories or have wrong extension
Solution:
- Check that files are 
.mdxnot.md - Verify files aren’t in 
node_modules,conceptual,overrides, or hidden directories - Set 
includeApiReference: trueif you need to scan that folder 
preserveExisting: false in folder scanning
Solution: Ensure PopulateNavigationFromPath uses preserveExisting: true (this is the default)
API Reference Not Generated
Symptom: No API Reference group appears in navigation
Cause: GenerateDocsJson is disabled or no types were documented
Solution:
- Set 
<GenerateDocumentation>true</GenerateDocumentation>in .docsproj - Verify XML documentation is enabled: 
<GenerateDocumentationFile>true</GenerateDocumentationFile> - Check that assemblies contain public types with XML comments