This document describes the overall architecture of the DocFX documentation generation system, including the major subsystems, their responsibilities, and how they interact with each other. It provides a technical overview of the codebase organization and the relationships between different components.
For information about individual CLI commands, see Command Line Interface. For details on configuration files, see Configuration System. For template development details, see Template System.
DocFX is organized as a multi-project .NET solution with frontend assets. The solution structure separates concerns into distinct layers:
Sources:
DocFX is composed of four primary subsystems that work together to generate documentation:
The CLI entry point is implemented using Spectre.Console.Cli for command parsing and routing. The main application class CommandApp is configured in the entry point with multiple command implementations.
The command options classes define the CLI interface contract:
BuildCommandOptions - Defines build command parameters including output folder, templates, serve options, debug mode, and parallelism settingsMetadataCommandOptions - Defines metadata extraction parametersPdfCommandOptions - Defines PDF generation parametersSources:
The template system consists of a frontend build pipeline that compiles TypeScript and Sass source files into production assets. The system supports two template variants: modern (Bootstrap 5 + lit-html) and default (Bootstrap 3 + jQuery).
The build script at templates/build.js1-149 orchestrates:
browser-sync development serverTemplate Configuration:
| Template | Framework | Component Library | CSS Preprocessor | Module Format |
|---|