Skip to content

jacobwi/Moka.Docs

Repository files navigation

.NET 9/10 MIT License Tests NuGet

MokaDocs

MokaDocs

The modern documentation site generator built for .NET libraries.

Point MokaDocs at your .csproj and docs/ folder.
It auto-discovers your API surface, parses XML docs, and generates a complete site.


Quick Start

# Install
dotnet tool install -g mokadocs

# Initialize in your project
mokadocs init

# Start dev server with hot reload
mokadocs serve

# Build for production
mokadocs build

Features

  • C# API Reference β€” Auto-generate docs from assemblies with full type info, XML comments, and <inheritdoc/> support
  • Markdown Guides β€” Admonitions, tabs, code groups, task lists, footnotes, and more via Markdig
  • Interactive REPL β€” Readers run C# code directly in the browser (Roslyn-powered)
  • Blazor Component Preview β€” Live-render Razor components in your docs
  • Mermaid Diagrams β€” Flowcharts, sequence diagrams, class diagrams with dark/light mode
  • UI Components β€” Cards, steps, link-cards, and code-group custom blocks
  • Release Changelog β€” Rich timeline UI with version badges, category filters, and collapsible entries
  • Full-Text Search β€” Client-side instant search with Ctrl+K / Cmd+K
  • 5 Color Themes β€” Ocean, Emerald, Violet, Amber, Rose with live switcher
  • 7 Code Syntax Themes β€” Catppuccin, GitHub, Dracula, One Dark, Nord
  • 4 Code Block Styles β€” Plain, macOS (traffic lights), Terminal, VS Code
  • Dark/Light Mode β€” Auto-detects system preference with manual toggle
  • Versioning β€” Multi-version docs with dropdown selector
  • Hot Reload β€” File watcher + WebSocket for instant preview
  • Feedback Widget β€” "Was this page helpful?" on every page
  • Type Dependency Graphs β€” Auto-generated Mermaid diagrams on API pages
  • ASP.NET Core Integration β€” Embed docs directly in your web app

ASP.NET Core Integration

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddMokaDocs(options =>
{
    options.Title = "My API Docs";
    options.Assemblies = [typeof(MyService).Assembly];
});

var app = builder.Build();
app.MapMokaDocs("/docs");
app.Run();

Configuration

# mokadocs.yaml
site:
  title: "My Library"
  description: "Documentation for My Library"

content:
  docs: ./docs
  projects:
    - path: ./src/MyLibrary/MyLibrary.csproj

theme:
  name: default
  options:
    primaryColor: "#0ea5e9"
    codeTheme: catppuccin-mocha
    codeStyle: macos

plugins:
  - name: mokadocs-repl
  - name: mokadocs-changelog

Packages

Package Description
Moka.Docs.Core Core models, configuration, and interfaces
Moka.Docs.CLI Command-line tool (mokadocs)
Moka.Docs.Engine Build pipeline and phase orchestration
Moka.Docs.Parsing Markdown parsing with custom extensions
Moka.Docs.CSharp Roslyn-based C# API analysis
Moka.Docs.Rendering Scriban template engine
Moka.Docs.Themes Theme system and default theme
Moka.Docs.Plugins Plugin system (REPL, Blazor, OpenAPI, Changelog)
Moka.Docs.Serve Dev server with hot reload
Moka.Docs.AspNetCore ASP.NET Core middleware integration
Moka.Docs.Search Client-side search index generation
Moka.Docs.Versioning Multi-version documentation support

Development

# Build
dotnet build MokaDocs.sln

# Test (384 tests across 5 projects x 2 TFMs)
dotnet test MokaDocs.sln

# Run self-documenting site
dotnet run --project src/Moka.Docs.CLI -- serve

# Run sample library site
cd samples/Moka.Docs.Samples.Library
dotnet run --project ../../src/Moka.Docs.CLI -- serve

License

MIT

About

πŸš€ Static docs generator for .NET - Roslyn-powered API docs, Markdig markdown, Scriban themes, live REPL, and ASP.NET Core+Python integration

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages