dartdoc_modern
Logodartdoc_modern

dartdoc_modern

Modern API Docs for Dart

Drop-in replacement for dart doc — generates a Jaspr or VitePress site with search, dark mode, guides, and full customization

API
Guide
{} </> /// .md

Highlights

The generated Jaspr site keeps the same polished docs shell, but reshapes it into a focused landing page.

📚

Full API Reference

Every class, function, and type gets its own page with badges, clickable type links, signatures, and source breadcrumbs.

🔍

Fast Offline Search

Built-in full-text search spans guide pages, API pages, and section headings without any external service.

🌗

Dark Mode & Theme Presets

Light and dark mode ship out of the box, and Jaspr theme presets let you retune the docs shell without rebuilding the app structure.

📖

Guide Pages

Put markdown files in doc/ or docs/ and they become guide routes with sidebar navigation next to the generated API docs.

📦

Workspace Docs

One command can generate a unified docs site for a Dart workspace with package-aware navigation and search.

🎮

Interactive Blocks

DartPad embeds, Mermaid diagrams, badges, callouts, and tabs all survive the generator pipeline.

🔗

Auto-Linking

Write API names in guides and the generator can keep them linkable across the docs site.

Incremental Generation

The generator only rewrites what changed, so large packages stay workable during iteration.

Install#

dart pub global activate dartdoc_modern

Usage#

Single package

dartdoc_modern --format jaspr --output docs-site
cd docs-site && dart pub get && jaspr serve

Mono-repo

dartdoc_modern --format jaspr \
  --workspace-docs \
  --exclude-packages 'example,test_utils' \
  --output docs-site
cd docs-site && dart pub get && jaspr serve

Dart SDK

dartdoc_modern --sdk-docs --format jaspr --output docs-site
cd docs-site && dart pub get && jaspr serve

Single package

dartdoc_modern --format vitepress --output docs-site
cd docs-site && npm install && npx vitepress dev

Mono-repo

dartdoc_modern --format vitepress \
  --workspace-docs \
  --exclude-packages 'example,test_utils' \
  --output docs-site

Dart SDK

dartdoc_modern --sdk-docs --format vitepress --output docs-site

dart doc vs dartdoc_modern#

dart docdartdoc_modern VitePressdartdoc_modern Jaspr
Output Static HTML VitePress (Markdown + Vue) Jaspr app (Dart + SSR/static build)
SearchBasicFull-text, offlineFull-text, offline
Dark modeNoYesYes
Guide docs No Auto from doc/ Auto from doc/
Mono-repo No --workspace-docs --workspace-docs
Build speed / file count Many HTML pages Much faster, far fewer files Much faster, far fewer files
DartPad embedsNoYesYes
Mermaid diagramsNoYes, with zoomYes, with runtime rendering
Customization Templates CSS, Vue components, plugins Dart components, theme tokens, CSS

Why It Builds Much Faster#

dartdoc_modern is dramatically faster largely because it writes dramatically fewer files.

Standard dartdoc creates a separate HTML page for every member. Every method, property, constructor, and constant gets its own full HTML page with head, navigation, sidebar, and footer. dartdoc_modern keeps members inline on the library or type page instead.

  • The Flutter Icons class has about 2,000 static constants. dartdoc turns that into about 2,001 pages for one class. dartdoc_modern keeps it on one page.
  • For the full Dart SDK, dartdoc generates roughly 15,000+ HTML files. dartdoc_modern generates about 1,800 markdown files, around 52 MB of source markdown.
  • For icon packages like material_design_icons_flutter with 7,000+ static const icons, dartdoc would emit 7,000+ individual pages. dartdoc_modern keeps that as one page.

This is a deliberate architectural choice, not a limitation. It reduces file-system churn, cuts I/O, speeds up builds, and makes browsing APIs better: you can Ctrl+F through the whole class, jump with the outline, and use search without opening dozens of member pages.

Live Example#

Dart SDK API docs generated with dartdoc_modern.

Live Versions#