Overview
Documentation Collections allow you to combine multiple independent.docsproj projects into a single unified documentation portal. This feature is perfect for:
- Microservices: Create a single portal for all services in your architecture
- Multi-Product Suites: Unify documentation across separate open-source products
- Modular Systems: Combine documentation from independently maintained modules
Collections are currently supported for Mintlify documentation only. Support for other documentation formats may be added in future releases.
How Collections Work
The collection.docsproj is a normal, first-class documentation project that:
- Has its own assemblies to document (or none at all)
- Has its own conceptual content and guides
- Has its own branding and theme configuration
- Generates its own documentation using the standard pipeline
- Copies markdown files from referenced projects into the collection’s folder structure
- Loads each referenced project’s
docs.jsonnavigation file - Applies URL prefixes to navigation paths
- Combines navigation into the collection’s Tabs or Products arrays
- Saves the final
docs.jsononce with everything integrated
Collection Root Content
Most documentation collections have their own landing pages, guides, and conceptual content that serve as the “home” for the unified portal. This root content provides:- Landing pages that introduce the overall platform or product suite
- Getting started guides that span multiple referenced projects
- Architecture documentation that explains how components fit together
- Shared resources like images and snippets used across the collection
Controlling Root Navigation with MintlifyTemplate
The<Navigation> element inside <MintlifyTemplate> controls how the collection’s own content appears alongside referenced documentation:
Configures how the collection’s root content integrates with referenced documentation.Attributes:
Navigation Type Examples
- Pages (Default)
- Tabs
- Products
Root content appears in the main navigation alongside groups. Referenced docs appear as tabs.
When
Type is Tabs or Products, the Name attribute determines the display label. If omitted, the collection’s <Name> value is used.Configuration
Using DocumentationReference
Add<DocumentationReference> items to your collection’s .docsproj file, similar to how you use <ProjectReference>:
Required Attributes
string
required
Relative or absolute path to the referenced
.docsproj file.string
required
URL path where the referenced documentation will be accessible. This becomes the URL prefix for all documentation from this reference.Files from the referenced project appear at URLs like:
services/user-service/api-reference/...services/user-service/guides/...
Optional Attributes
string
default:"Tabs"
How the reference’s navigation is integrated into the collection. Supported values:
Tabs- Adds as a top-level tab in Mintlify navigationProducts- Adds as a product in Mintlify’s multi-product navigation
string
Custom display name for this documentation in navigation. If not specified, the project file name (without extension) will be used.This is especially useful when project file names aren’t user-friendly (e.g.,
ServiceA.docsproj can display as “Authentication Service”).Integration Types
Mintlify supports two ways to integrate referenced documentation into your navigation structure.Tabs Integration
Tabs appear as top-level navigation items in your documentation site. This is the default integration type.docs.json:
If you omit the
Name attribute, the project file name is used (e.g., “UserService” and “OrderService”).Products Integration
Products are designed for multi-product documentation portals where each product has its own complete documentation set.docs.json:
Complete Examples
Example 1: Microservices Portal
Create a unified documentation portal for a microservices architecture: File:docs/MicroservicesPlatform.docsproj
Example 2: Multi-Product Suite
Create a unified portal for related open-source products: File:docs/EasyAF.Portal.docsproj
Example 3: Hybrid Collection
A collection that documents its own assemblies AND references external documentation:Validation and Safety
DotNetDocs validates references during the build process to ensure everything works correctly.Build-Time Validation
TheDocumentationReferenceResolverTask checks:
- Project Exists: The referenced
.docsprojfile must exist - Documentation Type Match: Referenced projects must use the same
DocumentationTypeas the collection - Outputs Exist: The referenced project must have generated documentation
- Navigation File Exists: For Mintlify projects,
docs.jsonmust exist
Type Mismatch Warnings
If you try to reference a project with a differentDocumentationType, you’ll see a warning:
URL Prefixes and Navigation
DotNetDocs automatically applies URL prefixes to all navigation paths when combining referenced documentation.How Prefixes Work
Given this reference:ServiceA/docs.json:
Deep Prefix Application
URL prefixes are applied recursively at all nesting levels:- String pages: Direct path strings
- Groups: Pages inside navigation groups
- Tabs: Pages inside nested tabs
- Dropdowns: Pages inside dropdown menus
File Copying Behavior
DotNetDocs copies documentation files based on the referenced project’sDocumentationType.
Mintlify File Patterns
For Mintlify references, these patterns are copied:*.md,*.mdx,*.mdz- All markdown filesimages/**/*- All imageslogo/**/*- Logo assets
Conflict Resolution
If the same file exists in both the collection and a reference:Collection wins: The collection’s file is kept, and the referenced file is skipped. This allows the collection to override content from references.
Build Process
Understanding the build order helps troubleshoot issues:1
Build Referenced Projects
Build each referenced
.docsproj first. This generates their documentation outputs.2
Build Collection
Build the collection
.docsproj. It validates references, copies files, and combines navigation.3
Validation
The SDK validates that:
- Referenced projects exist
- Documentation types match
- Documentation outputs are available
4
Collection Generation
The collection generates its own documentation (if
GenerateDocumentation=true).5
File Copying
Files from referenced projects are copied to
DestinationPath locations.6
Navigation Combining
The
MintlifyRenderer combines navigation from all references into the collection’s docs.json.7
Save
The final
docs.json is saved once with everything combined.Troubleshooting
”Referenced project not found”
Problem: The.docsproj path is incorrect or the file doesn’t exist.
Solution: Verify the path in your DocumentationReference is correct. Use relative paths from the collection .docsproj location.
”Documentation root does not exist”
Problem: The referenced project hasn’t been built yet, so its documentation outputs don’t exist. Solution: Build referenced projects before building the collection:“Skipping documentation reference… uses different format”
Problem: The referenced project uses a differentDocumentationType than the collection.
Solution: Ensure all referenced projects use the same documentation type. Collections can only combine documentation of the same format (currently Mintlify only).
Missing navigation or broken links
Problem: URL prefixes aren’t being applied correctly, or files aren’t being copied. Solution:- Check that
DestinationPathmatches where files are actually copied - Verify the referenced project’s
docs.jsonexists and is valid JSON - Rebuild both the references and collection from scratch
Best Practices
Limitations
Current limitations of Documentation Collections:- Mintlify Only: Collections currently only work with Mintlify documentation. Support for DocFX, MkDocs, etc. may be added later.
- No Cross-Format: You cannot combine Mintlify and DocFX documentation in the same collection. All references must use the same format.
- Build-Time Only: Collections are resolved at build time. You cannot dynamically add references at runtime.
- No Transitive References: If ProjectA references ProjectB, and you reference ProjectA in your collection, you don’t automatically get ProjectB. Each reference must be explicit.
- Single SDK Version: All referenced projects should use the same (or compatible) versions of DotNetDocs.Sdk to ensure consistent behavior.