fastdocs
v0.6.2
Published
Zero-config markdown documentation viewer and static site generator powered by VitePress
Maintainers
Readme
Fast Docs
An ultralight, zero-config markdown documentation viewer and static site generator.
Quick Start
View your markdown docs instantly:
npx fastdocs serve ./docsBuild a static site for deployment:
npx fastdocs build ./docs ./outputCustomize with a config file:
npx fastdocs init ./docs
# Edit .fastdocs, then serve or buildFeatures
- 🚀 Zero Setup - No installation, no configuration required
- 📁 Auto-Discovery - Automatically builds navigation from your folder structure
- 🔍 Built-in Search - Full-text search out of the box
- 📖 Table of Contents - Automatic TOC from headings
- 🎨 Custom Components - SubPages and FullContents components
- 🎯 Icon Support - Use Lucide icons for logo and favicon
- ⚡ Hot Reload - Instant updates during development
- 🎯 Frontmatter Support - Optional YAML frontmatter for ordering and metadata
- 🏗️ Static Site Generation - Deploy anywhere static hosting works
Installation
No installation needed! Use with npx:
npx fastdocs serveOr install globally:
npm install -g fastdocs
fastdocs serve ./docsDocumentation
For complete documentation, guides, and examples, visit nldlabs.github.io/fastdocs.
Commands
init
Create a .fastdocs configuration file with default settings in your documentation directory.
fastdocs init [path]Arguments:
path- Directory to create config in (default: current directory)
Options:
-f, --force- Overwrite existing config without confirmation
Examples:
# Create config in current directory
fastdocs init
# Create config in specific directory
fastdocs init ./docs
# Overwrite existing config
fastdocs init --forceThe generated .fastdocs file includes all available options with sensible defaults. Edit it to customize your documentation site.
serve
Start a local development server to view your documentation.
fastdocs serve [path] [options]Arguments:
path- Path to documentation directory (default: current directory)
Options:
-p, --port <number>- Port number (default: 5173)--no-open- Don't open browser automatically--host- Allow external access
Examples:
# Serve current directory
fastdocs serve
# Serve specific directory
fastdocs serve ./my-docs
# Use custom port
fastdocs serve ./docs --port 3000
# Allow external access
fastdocs serve ./docs --hostbuild
Build a static site from your documentation.
fastdocs build [input] [output] [options]Arguments:
input- Source directory (default: current directory)output- Output directory (default: ./dist)
Options:
--base <path>- Base URL path for deployment (default: /)--clean- Clean output without confirmation
Examples:
# Build with defaults
fastdocs build
# Specify input and output
fastdocs build ./docs ./public
# Deploy to subdirectory
fastdocs build ./docs ./dist --base /my-project/
# Skip confirmation prompt
fastdocs build ./docs ./dist --cleanConfiguration
fastdocs works great with zero configuration, but you can customize it by creating a .fastdocs file in your documentation directory.
Quick start:
# Generate a config file with defaults
fastdocs initExample .fastdocs:
{
"title": "My Documentation",
"description": "Comprehensive project documentation",
"logo": "lucide:book-open",
"favicon": "lucide:book-open",
"search": true,
"sidebar": {
"collapseFolders": false
},
"outline": {
"enabled": true,
"depth": [2, 3],
"label": "On this page"
}
}Configuration Options:
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| title | string | Folder name | Site title |
| description | string | "Documentation" | Site description |
| logo | string/object | null | Path to logo file or Lucide icon (e.g., "lucide:book-open", or {"type": "lucide", "icon": "book-open", "color": "#3b82f6"}) |
| favicon | string/object | null | Path to favicon or Lucide icon with optional color |
| search | boolean | true | Enable search |
| sidebar.collapseFolders | boolean | false | Collapse sidebar folders by default |
| outline.enabled | boolean | true | Show table of contents |
| outline.depth | array | [2, 3] | Heading levels to show |
| outline.label | string | "On this page" | TOC heading |
Frontmatter
Add YAML frontmatter to any markdown file for ordering and metadata:
---
title: Getting Started
order: 1
description: Introduction to the project
---
# Getting Started
Your content here...Frontmatter Fields:
title- Override page title in navigationorder- Numeric sort order (lower numbers appear first)description- Page description for SEOcollapsed- (index.md only) Override sidebar folder collapse state
Custom Components
fastdocs includes custom Vue components you can use in your markdown:
SubPages
Show all child pages of the current section:
# My Section
<SubPages />FullContents
Show the entire site structure (great for index pages):
# Welcome
<FullContents />Folder Structure
fastdocs automatically generates navigation from your folder structure:
docs/
├── index.md # Home page
├── guide/
│ ├── index.md # Guide overview (makes folder clickable)
│ ├── getting-started.md
│ └── advanced.md
└── api/
├── index.md
└── reference.mdTips:
- Use
index.mdfiles as folder landing pages - Add
orderin frontmatter to control sort order - Folders without markdown files are hidden
- Nested folders create nested navigation
Deployment
The build command generates a static site ready for any hosting platform:
GitHub Pages
fastdocs build ./docs ./dist --base /repo-name/
# Deploy ./dist to gh-pages branchNetlify
fastdocs build ./docs ./dist
# Deploy ./dist directoryVercel
fastdocs build ./docs ./dist
# Deploy ./dist directoryHow It Works
fastdocs creates a temporary VitePress project outside your documentation directory, keeping your docs folder clean. When you run serve or build:
- Scans your documentation directory
- Generates VitePress configuration
- Creates temporary project in system temp directory
- Runs VitePress with
srcDirpointing to your docs - Cleans up on exit
Your documentation folder stays pristine - no node_modules, no .vitepress folder, just your markdown files.
Requirements
- Node.js 18 or higher
License
MIT
Credits
Built on VitePress - the Vite & Vue powered static site generator.
