One command turns a Markdown folder into a beautiful doc site with live preview.
一条命令,把 Markdown 文件夹变成漂亮的文档站,实时预览。
You're writing project docs in Markdown. You want to see them rendered nicely — sidebar navigation, code highlighting, dark mode — without configuring MkDocs, Docusaurus, or VitePress. You want to hit save and see the change instantly. docfly is that. No config. No build step. One command.
你在用 Markdown 写项目文档。你想看到漂亮的渲染效果 — 但不想要 MkDocs / Docusaurus 那样复杂的配置。你想保存即看。docfly 就是这个。
pip install docflydocfly ./docs # 启动 / Start on :8080
docfly ./docs --open # 自动打开浏览器 / Open browser
docfly ./docs -p 3000 # 自定义端口 / Custom port
docfly ./docs --no-watch # 关闭实时预览 / No live reload| Feature 功能 | Description 说明 |
|---|---|
| ⚡ Live reload / 实时预览 | Edit .md → browser refreshes instantly (WebSocket) |
| 🎨 Code highlighting / 代码高亮 | Pygments monokai theme, 50+ languages |
| 🌓 Dark & light / 深浅主题 | One-click toggle, preference saved |
| 📂 Nested nav / 嵌套导航 | Sidebar mirrors your folder structure |
| 🏷️ Front-matter | title, order — control display name and sort |
| 📑 Permalinks / 标题锚点 | Every heading gets an anchor link |
docs/
├── index.md → /
├── getting-started.md → /getting-started
└── api/
├── overview.md → /api/overview
└── auth.md → /api/auth
---
title: Getting Started # or: 快速开始
order: 1
---FastAPI + Jinja2 + WebSocket + watchfiles + Pygments. ~250 lines of core logic / 核心逻辑约 250 行。
MIT