Mintlify.Core
Mintlify.Core is a comprehensive .NET library for working with Mintlify documentation configuration files (docs.json). This package provides robust loading, validation, manipulation, and generation capabilities for Mintlify documentation projects.
Install
| Product | Versions |
|---|---|
| .NET | |
| .NET Standard |
README
Mintlify.Core
Mintlify.Core is a comprehensive .NET library for working with Mintlify documentation configuration files (docs.json). This package provides robust loading,
validation, manipulation, and generation capabilities for Mintlify documentation projects.
Brought to you by:
Features
- Complete Configuration Management: Load, validate, save, and manipulate
docs.jsonfiles - Intelligent Navigation Merging: Merge multiple documentation configurations with smart deduplication
- Directory-Based Navigation Generation: Automatically build navigation from folder structures
- URL Management: Apply prefixes and transformations to navigation URLs
- Type-Safe Models: Strongly-typed classes for all Mintlify configuration options
- Comprehensive Validation: Built-in validation with detailed error reporting
- Multiple Target Frameworks: Supports .NET 8+, .NET 9+, .NET 10+, and .NET Standard 2.0
Installation
Install via NuGet Package Manager:
dotnet add package Mintlify.Core
Or via Package Manager Console:
Install-Package Mintlify.Core
Quick Start
Loading and Working with docs.json
using Mintlify.Core;
// Load from file path
var manager = new DocsJsonManager("path/to/docs.json");
manager.Load();
// Or load from string content
var manager2 = new DocsJsonManager();
manager2.Load(jsonString);
// Access configuration
if (manager.IsLoaded)
{
Console.WriteLine($"Site name: {manager.Configuration.Name}");
Console.WriteLine($"Theme: {manager.Configuration.Theme}");
}
// Check for errors
if (manager.ConfigurationErrors.Any())
{
foreach (var error in manager.ConfigurationErrors)
{
Console.WriteLine($"{error.ErrorNumber}: {error.ErrorText}");
}
}
Creating Default Configuration
// Create a new documentation configuration
var config = DocsJsonManager.CreateDefault("My Documentation", "mint");
var manager = new DocsJsonManager();
manager.Configuration = config;
manager.Save("docs.json");
Merging Configurations
var mainManager = new DocsJsonManager("main-docs.json");
mainManager.Load();
var additionalManager = new DocsJsonManager("additional-docs.json");
additionalManager.Load();
// Merge configurations with intelligent navigation combining
mainManager.Merge(additionalManager.Configuration);
// Or merge only navigation (skip base properties)
mainManager.Merge(additionalManager.Configuration, combineBaseProperties: false);
Auto-Generating Navigation from Directory Structure
var manager = new DocsJsonManager();
manager.Configuration = DocsJsonManager.CreateDefault("My Docs");
// Scan directory and build navigation automatically
manager.PopulateNavigationFromPath("./docs", new[] { ".md", ".mdx" });
// Apply URL prefix to all navigation items
manager.ApplyUrlPrefix("/v2");
manager.Save("docs.json");
Key Features
Configuration Management
Load, validate, save, and manipulate docs.json files with intelligent error reporting.
Navigation Merging
Merge multiple documentation configurations with smart deduplication - perfect for multi-project solutions.
Directory-Based Generation
Automatically build navigation from your folder structure.
URL Transformation
Apply prefixes and transformations to navigation URLs for versioning or multi-tenancy.
Requirements
- .NET 8.0+ (for modern C# features and performance)
- .NET 9.0+ (fully supported)
- .NET 10.0+ (fully supported)
- .NET Standard 2.0 (for broader compatibility)
Dependencies
- System.Text.Json (for JSON serialization)
- System.CodeDom (for error reporting)
See Also
- Full Documentation - Complete guides and examples
- DotNetDocs CLI - Get up and running fast with our easy CLI
- DotNetDocs.Sdk - MSBuild SDK for .docsproj projects
- DotNetDocs.Core - Core documentation engine
- DotNetDocs.Mintlify - Enhanced Mintlify.com support
License
MIT License - see LICENSE for details.
Changes from Previous Version
Adoption Assessment
Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.