Mintlify.Core 1.0.0-preview.5

This is a prerelease version of Mintlify.Core.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Mintlify.Core --version 1.0.0-preview.5
                    
NuGet\Install-Package Mintlify.Core -Version 1.0.0-preview.5
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Mintlify.Core" Version="1.0.0-preview.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Mintlify.Core" Version="1.0.0-preview.5" />
                    
Directory.Packages.props
<PackageReference Include="Mintlify.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Mintlify.Core --version 1.0.0-preview.5
                    
#r "nuget: Mintlify.Core, 1.0.0-preview.5"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Mintlify.Core@1.0.0-preview.5
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Mintlify.Core&version=1.0.0-preview.5&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Mintlify.Core&version=1.0.0-preview.5&prerelease
                    
Install as a Cake Tool

Mintlify.Core

NuGet Downloads License

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.

Features

  • Complete Configuration Management: Load, validate, save, and manipulate docs.json files
  • 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");

Advanced Usage

Custom Validation

var manager = new DocsJsonManager("docs.json");
manager.Load();

// Apply additional defaults
manager.ApplyDefaults();

// Validate and get detailed feedback
if (!manager.IsLoaded)
{
    var errors = manager.ConfigurationErrors.Where(e => !e.IsWarning);
    var warnings = manager.ConfigurationErrors.Where(e => e.IsWarning);
    
    Console.WriteLine($"Found {errors.Count()} errors and {warnings.Count()} warnings");
}

Working with Navigation Structures

// Access navigation elements
var navigation = manager.Configuration.Navigation;

if (navigation.Groups?.Any() == true)
{
    foreach (var group in navigation.Groups)
    {
        Console.WriteLine($"Group: {group.Group}");
        if (group.Pages?.Any() == true)
        {
            foreach (var page in group.Pages.OfType<string>())
            {
                Console.WriteLine($"  Page: {page}");
            }
        }
    }
}

Error Handling

try
{
    var manager = new DocsJsonManager("docs.json");
    manager.Load();
    
    if (!manager.IsLoaded)
    {
        throw new InvalidOperationException("Failed to load configuration");
    }
}
catch (FileNotFoundException)
{
    // Handle missing file
    var defaultConfig = DocsJsonManager.CreateDefault("New Documentation");
    // ... initialize with defaults
}
catch (ArgumentException ex)
{
    // Handle invalid arguments (e.g., invalid file paths)
    Console.WriteLine($"Invalid argument: {ex.Message}");
}

Configuration Model

The library provides strongly-typed models for all Mintlify configuration options:

  • DocsJsonConfig: Root configuration object
  • NavigationConfig: Navigation structure with pages, groups, tabs, anchors
  • GroupConfig: Documentation groups with nested pages
  • TabConfig: Tab-based navigation sections
  • ColorsConfig: Theme color customization
  • LogoConfig: Logo configuration for light/dark themes
  • FooterConfig: Footer links and social media
  • And many more...

URL Management

Transform and prefix navigation URLs:

// Apply prefix to all URLs in navigation
manager.ApplyUrlPrefix("/api/v1");

// This transforms:
// "getting-started" → "/api/v1/getting-started"
// "guides/authentication" → "/api/v1/guides/authentication"
// Group roots, tab hrefs, anchor hrefs are all updated recursively

Build navigation from directory structure:

// Given directory structure:
// docs/
//   getting-started.md
//   guides/
//     authentication.md
//     deployment.md
//   api/
//     endpoints.md

manager.PopulateNavigationFromPath("./docs");

// Generates navigation:
// {
//   "pages": [
//     "getting-started",
//     {
//       "group": "Guides", 
//       "pages": ["guides/authentication", "guides/deployment"]
//     },
//     {
//       "group": "Api",
//       "pages": ["api/endpoints"] 
//     }
//   ]
// }

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)
  • CloudNimble.EasyAF.Core (internal utilities)

Contributing

Contributions are welcome! This library is part of the EasyAF Framework.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Mintlify.Core:

Package Downloads
DotNetDocs.Mintlify

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-preview.11 0 9/13/2025
1.0.0-preview.10 74 9/5/2025
1.0.0-preview.9 118 9/5/2025
1.0.0-preview.8 124 9/3/2025
1.0.0-preview.7 114 9/1/2025
1.0.0-preview.6 111 9/1/2025
1.0.0-preview.5 132 8/30/2025
1.0.0-preview.4 158 8/29/2025
1.0.0-preview.3 162 8/29/2025
1.0.0-preview.2 161 8/28/2025
1.0.0-preview.1 166 8/27/2025