dochub
v2.0.0
Published
A modern documentation generator with live-reload dev server and static site builder
Maintainers
Readme
DocHub
Write Markdown. Ship beautiful documentation.
DocHub is a zero-config documentation tool that turns a folder of Markdown files into a modern, searchable, themeable documentation site. Use it as a live-reload dev server during writing, then export a fully self-contained static site for deployment.
Features
| | |
|---|---|
| Live preview | Dev server with instant reload on file changes |
| Static export | Build a portable HTML site with clean URLs (/guide, /api/auth) |
| Full-text search | Client-side search across all pages with relevance scoring |
| Dark mode | Light/dark toggle with persistent preference |
| Syntax highlighting | 190+ languages via Highlight.js |
| File-tree sidebar | Auto-generated navigation from your folder structure |
| Responsive | Works on desktop, tablet, and mobile |
| Self-contained | Zero external CDN dependencies in the output |
Install
npm install -g dochubQuick start
# Scaffold a new project
dochub init my-docs
# Start writing — open http://localhost:3000
cd my-docs && dochub serve
# Build for production
dochub buildProject structure
my-docs/
├── markdown/ # Your content — add .md files here
│ ├── README.md # Home page (/)
│ ├── guide.md # /guide
│ ├── api/
│ │ ├── README.md # /api
│ │ └── authentication # /api/authentication
│ └── deployment/
│ └── README.md # /deployment
└── dochub.config.js # Site configurationEvery folder becomes a collapsible sidebar section. README.md inside a folder becomes the folder's index page at a clean URL (/api not /api/readme).
Commands
dochub init [directory]
Scaffolds a new documentation project with a markdown/ folder containing starter pages and a dochub.config.js.
dochub init my-project # Creates ./my-projectdochub serve [directory]
Starts a development server with WebSocket live reload. Changes to any .md file instantly refresh the browser.
dochub serve # Serve current directory
dochub serve my-project # Serve a specific project
dochub serve -p 4000 # Custom portdochub build [directory]
Generates a static HTML site with clean URLs. Each page becomes a directory with index.html — deployable to any static host (Netlify, Vercel, GitHub Pages, S3, etc.).
dochub build # Build to ./dist
dochub build -o docs # Build to ./docsConfiguration
Edit dochub.config.js in your project root:
module.exports = {
title: 'My API Docs',
description: 'Everything you need to build with our API',
};The title appears in the browser tab, page header, and search metadata.
Writing documentation
DocHub uses standard Markdown. All files go in markdown/ and URLs are derived from the file path:
| File | URL |
|---|---|
| markdown/README.md | / |
| markdown/guide.md | /guide |
| markdown/api/README.md | /api |
| markdown/api/authentication.md | /api/authentication |
Supported syntax
- Headers (h1–h6), bold, italic, strikethrough, inline code
- Fenced code blocks with syntax highlighting
- Ordered and unordered lists (nested too)
- Links, images, blockquotes, horizontal rules
- Tables with header alignment
Deployment
The build command outputs a static dist/ folder:
dist/
├── index.html
├── guide/
│ └── index.html
├── api/
│ └── index.html
├── folder/
│ └── index.html
└── 404.htmlDeploy the entire dist/ folder to any static file host:
dochub build
# Drag dist/ onto Netlify Drop, or
npx netlify-cli deploy --dir=dist --proddochub build
npx vercel dist --proddochub build
# Push dist/ contents to gh-pages branch, or
# use actions/upload-pages-artifactdochub build
npx serve distWhy DocHub?
There are many documentation tools. Here's where DocHub fits:
| | DocHub | Docusaurus | VitePress | |---|---|---|---| | Setup time | seconds | minutes | minutes | | Language | Markdown | MDX + React | Markdown + Vue | | Build output | ~20KB pages | ~200KB+ JS bundle | ~100KB+ JS bundle | | Dependencies | 5 packages | 200+ packages | 100+ packages | | Config | 5-line JS file | Full Docusaurus config | Full VitePress config |
DocHub is for teams that want to write Markdown and ship docs without learning a framework or managing hundreds of dependencies.
License
MIT
