compodocx
Static documentation generator for modern Angular projects. Reads your TypeScript source, component templates, and (S)CSS, and emits a self-contained HTML site.
Documentation: compodocx.dev
Why compodocx
The successor to compodoc for modern Angular, not a drop-in replacement. It documents Angular 21+ standalone code (signal inputs, outputs and models, inject(), the structured host metadata, functional guards, interceptors and resolvers) and adds a Theming tab driven by JSDoc/SassDoc-style comments above your CSS / SCSS tokens. The rendering layer is new (JSX templates, Tailwind v4, Pagefind, D3).
NgModules, decorator members (@Input, @Output, @HostBinding, @HostListener), constructor injection in Angular classes and class-based guards, interceptors and resolvers are not documented; a run reports them in one legacy notice. Page URLs and the JSON export schema differ from compodoc. Switching from compodoc means changing the package and the script, running it, and acting on the warnings it prints; MIGRATION.md explains each one.
Requirements
- Node.js 22 or newer
- An Angular project with a
tsconfig.json(Angular 21+, standalone code; tested against 21 and 22)
Install
npm install --save-dev @cngxjs/compodocx
Inside an Angular workspace, the schematic seeds tsconfig.doc.json, registers npm scripts, and (if you are coming from @compodoc/compodoc) replaces the package and rewrites compodoc scripts in one pass:
ng add @cngxjs/compodocx
Quick start
# Generate static documentation into ./docs
npx compodocx -p tsconfig.app.json -d docs
# Generate, serve, open in browser
npx compodocx -p tsconfig.app.json -d docs -s -o
# Watch + rebuild on every change
npx compodocx -p tsconfig.app.json -d docs -s -w
# Coverage check that fails CI under 70%
npx compodocx -p tsconfig.app.json -d docs --coverageTest 70 --coverageTestThresholdFail
The CLI is also exposed as compodoc, so existing npm scripts keep running.
Configuration
Drop a .compodocxrc.json (or .yaml, .js) into your project root. The older .compodocrc names are still found:
{
"tsconfig": "./tsconfig.app.json",
"output": "./docs",
"theme": "ocean"
}
Full reference for every CLI flag and config key: docs/configuration.md or compodocx.dev/guides/options.
Documentation
| Topic | File |
|---|---|
| Configuration reference | docs/configuration.md |
| Custom JS template overrides | docs/custom-templates.md |
| Theme tokens in SCSS / CSS | docs/theming-tokens-authoring-guide.md |
| Additional Markdown pages | docs/additional-pages.md |
| Multi-version output | docs/versioned-docs.md |
| JSON export schema history | docs/json-export.md |
| Internationalization | docs/i18n.md |
| Migrating from compodoc | MIGRATION.md |
| Releasing | docs/RELEASING.md |
Development
git clone https://github.com/cngxjs/compodocx.git
cd compodocx
npm ci
npm run build
npm run test:all
| Task | Command |
|---|---|
| Unit tests | npm run test:unit |
| CLI integration tests | npm run test:cli |
| Playwright e2e | npm run test-e2e-playwright |
| Lint / Format | npm run lint / npm run format:write |
The dev watcher rebuilds the docs site for the standalone fixture whenever a source file changes:
npm run dev # port 8081
Issues and pull requests welcome at github.com/cngxjs/compodocx.
Acknowledgments
compodocx is a fork of compodoc by Vincent Ogloblinsky and contributors. Its compiler and JSDoc tag handling are the foundation everything here builds on.
License
MIT. See LICENSE.