Skip to content

timqian/docdude

Repository files navigation

DocDude

English | 中文 | 日本語 | 한국어

DocDude generates a static documentation website from a directory of markdown files. For example the chart.xkcd documentation is generated with:

npx docdude --in docs --out docs-dist --title Chart.xkcd --subtitle 'xkcd styled chart lib'

Markdown Format

Frontmatter

  • title (required) - Page title in sidebar and content
  • slug (optional) - URL slug (auto-generated from title if omitted)
  • skip (optional) - Set to true to exclude from output

Special Syntax

Note Callouts:

Note: This text will be highlighted as an important note.

Code Blocks:

function hello() {
  console.log('Hello!');
}

Programmatic API

import { compile } from './src/compile.js';

await compile({
  src: './docs',
  dst: './build',
  title: 'My Project',
  subtitle: 'Documentation',
  theme: 'apex',
  segment: '',
  google: ''
});

Project Structure

docdude/
├── bin/static-docs.js    # CLI entry point
├── src/
│   ├── compile.js        # Core compilation logic
│   ├── markdown.js       # Markdown → HTML
│   ├── html.js           # HTML post-processing
│   ├── highlight.js      # Syntax highlighting
│   ├── inject.js         # Analytics injection
│   └── theme/apex/       # Default theme
├── package.json
└── README.md

Tech Stack

  • Markdown: marked
  • Frontmatter: gray-matter
  • Templating: handlebars
  • DOM: cheerio
  • Highlighting: highlight.js
  • CLI: commander

Story

Docdude was initially a Node.js rewrite of apex/static. Static was created by TJ in January 2018, and I used it to generate the docs site for chart.xkcd back then. When I tried to update the docs in 2026, I found that this tool was no longer usable. So I rewrote it with the help of Claude Code and started adding new features, such as mobile compatibility.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors