docudart 0.1.0 copy "docudart: ^0.1.0" to clipboard
docudart: ^0.1.0 copied to clipboard

A static documentation generator for Dart, powered by Jaspr.

A static documentation generator
powered by Jaspr

Pub Package Build Status MIT License Documentation

Features #

  • Markdown-first — Write docs in Markdown with YAML frontmatter
  • Rich Markdown componentsCallout, Tabs, CodeBlock, Card / CardGrid embedded via MDX-like syntax
  • Live reload — Instant preview with docudart serve
  • Light & dark mode — System preference detection with manual toggle
  • Responsive design — Mobile sidebar drawer, CSS breakpoints via context.screen
  • Flutter-like APIRow, Column, IconButton, SlideTransition — looks like Flutter, outputs HTML/CSS/JS
  • 52,000+ icons — 7 icon families (Material, Lucide, Tabler, Font Awesome, Fluent, Remix, Material Symbols)
  • Collapsible sidebar — Auto-generated from folder structure with _expanded suffix control
  • Type-safe configconfig.dart with full IntelliSense, not YAML
  • Custom pages — Add Jaspr components to pages/ for landing pages, changelogs, etc.
  • Type-safe assetscontext.project.assets.logo.logo_webp auto-generated from your assets/ directory
  • Theming — 3 built-in presets (Classic, Material 3, shadcn) with seed color support
  • Auto-discovered pages — Just add a .dart file to pages/ and link to it
  • SEO built-in — Canonical URLs, Open Graph tags, JSON-LD, and noindex frontmatter support
  • Accessible — Skip-to-content link, aria-expanded attributes, keyboard navigation, semantic HTML

Quick Start #

Installation #

dart pub global activate docudart

Create a project #

# Inside your Dart project directory:
docudart create --full

This creates a docudart/ subdirectory with config, docs, components, and pages.

Preview locally #

docudart serve

Open http://localhost:8080 — changes to docs, config, and components reload automatically.

Build for production #

docudart build

Output goes to docudart/build/web/ — ready to deploy to any static hosting.

CLI Reference #

Command Description
docudart create [name] Scaffold a new project. --full for all features, --directory to set target.
docudart serve Dev server with live reload. --port (default 8080), --no-watch to disable.
docudart build Build for production. --output to override output directory.
docudart update Update DocuDart to the latest version.
docudart version Print current version and check for updates.

Markdown Components #

Embed rich components directly in your Markdown files using MDX-like syntax:

Callout #

<Callout type="tip" title="Did you know?">
DocuDart supports **Markdown** inside components.
</Callout>

Available types: info, tip, warning, danger, note.

Tabs #

<Tabs>
<Tab label="Dart">
Content for the Dart tab.
</Tab>
<Tab label="Flutter">
Content for the Flutter tab.
</Tab>
</Tabs>

CodeBlock #

<CodeBlock language="dart" title="main.dart" lineNumbers={true}>
void main() => print('Hello, DocuDart!');
</CodeBlock>

Card Grid #

<CardGrid cols={3}>
<Card title="Quick Start" icon="🚀" href="/docs/quick-start">
Get up and running in minutes.
</Card>
<Card title="Theming" icon="🎨" href="/docs/theming">
Customize colors and presets.
</Card>
</CardGrid>

Responsive Design #

Use context.screen for CSS-based responsive layouts with no JavaScript:

context.screen.when(
  desktop: () => Row(children: [sidebar, content]),
  tablet: () => Column(children: [topNav, content]),
  mobile: () => Column(children: [content]),
);

Breakpoints: mobile ≤ 768px, tablet 769–1024px, desktop 1025px+.

Configuration #

DocuDart uses a config.dart file (not YAML) for type-safe configuration:

import 'package:docudart/docudart.dart';

Config configure(BuildContext context) => Config(
  title: context.project.pubspec.name,
  description: context.project.pubspec.description,
  themeMode: .system,
  home: () => LandingPage(title: 'My Project'),
  header: () => Header(
    leading: Logo(title: 'My Project'),
    links: [.path('/docs', label: 'Docs')],
  ),
  sidebar: () => context.url.contains('/docs')
      ? Sidebar(items: context.project.docs)
      : null,
);

Requirements #

  • Dart SDK ^3.10.0

Documentation Structure #

docudart/
  config.dart          # Type-safe configuration
  docs/                # Markdown documentation
    index.md
    getting-started.md
    01-guides_expanded/ # _expanded = starts open in sidebar
      components.md
  pages/               # Custom Jaspr pages
    landing_page.dart
  components/          # Reusable components
    header.dart
    footer.dart
  assets/              # Static assets (logo, images)

Contributing #

Contributions are welcome! See CONTRIBUTING.md for guidelines.

License #

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