Docsify
Docsify turns Markdown files into a documentation website at runtime — there is no static build step. A single index.html boots docsify.js, which fetches and renders .md files dynamically.
Targets Docsify v5 by default. v5 is currently published only as a release candidate (5.0.0-rc.4) — all CDN URLs in this skill pin to that exact version. Use docsify@rc (dist-tag) to track the latest 5.x RC, and switch to docsify@5 only after v5 stable is published. If the user needs the long-stable line, use docsify@4 (CDN path /lib/ instead of /dist/). For v4 migration guidance, load references/advanced.md.
When to load which reference
Load only the references needed for the current task — do not preload everything.
| Task | Load |
|---|---|
Bootstrap a brand-new site / write index.html / docsify-cli usage |
references/getting-started.md (+ assets/index.html) |
Add pages, build _sidebar.md / _navbar.md / _coverpage.md, multi-language layout, TOC |
references/pages-and-navigation.md |
Set or look up any window.$docsify option |
references/configuration.md |
Docsify-specific Markdown syntax (callouts, link/image attrs, heading IDs, embed :include, code highlight) |
references/markdown-helpers.md |
| Theme switching, CSS variables, custom fonts, body classes, dark mode | references/themes-and-styling.md |
| Install / configure built-in or community plugins | references/plugins.md |
| Write a custom Docsify plugin (lifecycle hooks) | references/writing-plugins.md |
| Deploy to GitHub Pages, GitLab, Netlify, Vercel, Firebase, Docker, Nginx, AWS Amplify, etc. | references/deployment.md |
| PWA / offline, virtual routes, Vue components, v4 → v5 upgrade | references/advanced.md |
Core mental model
A Docsify site needs only three things:
index.html— single boot file that loadsdocsify.js, a theme CSS, optional plugins, and defineswindow.$docsifyconfig.- Markdown files —
README.mdis the homepage; any other*.mdis a route (e.g.guide.md→/#/guide). - Special underscore files (optional but common):
_sidebar.md— sidebar menu (requiresloadSidebar: true)_navbar.md— top navbar (requiresloadNavbar: true)_coverpage.md— landing cover (requirescoverpage: true)_404.md— custom 404 (requiresnotFoundPage: true)_media/— images and other assets.nojekyll— required on GitHub Pages so underscore files are served
Subfolders define nested routes; nested _sidebar.md / _navbar.md override parent ones (used for multi-language sites).
Quick start workflow
For "set up a new Docsify site" requests:
- Read
references/getting-started.mdfor the canonicalindex.htmland CLI commands. - Copy
assets/index.htmlinto the site folder and adjust thename,repo, theme add-ons, and plugin<script>tags. - Create
README.md(homepage) and.nojekyll(empty file). - If the user wants a sidebar/navbar/cover, also load
references/pages-and-navigation.md. - Verify locally with
docsify serve <folder>(orpython3 -m http.server).
Key conventions to preserve
- Always pin an exact CDN version. v5 is in RC: use
docsify@5.0.0-rc.4(or the@rctag) until v5 stable releases — the shorthanddocsify@5does not resolve today. For the long-stable line, usedocsify@4with CDN path/lib/instead of/dist/. Seeassets/index.html. - Theme CSS must come before Docsify JS; theme add-ons must come after the core theme; Prism language/theme files and plugin scripts must come after
docsify.min.js. .nojekyllis mandatory whenever the site is on GitHub Pages and uses any_*.mdfile.- Hash routing is the default (
/#/page). Only switch torouterMode: 'history'if the host can rewrite URLs toindex.html, and addaliasentries for_sidebar.md/_navbar.md(seereferences/configuration.md). - Underscore files fall back up the directory tree —
/guide/_sidebar.mdis used if present, otherwise/_sidebar.md. - Docsify renders Markdown via marked and syntax-highlights via Prism (load extra Prism language components after
docsify.min.js).
Common gotchas
- Forgetting
.nojekyll→ GitHub Pages 404s on_sidebar.md. - Putting plugin
<script>tags beforedocsify.min.js→ plugin never registers. - Setting
coverpage: truewithout creating_coverpage.md→ blank landing. - Using
routerMode: 'history'on a static host without rewrite rules → deep links 404 on refresh. - Mermaid: Docsify only supports synchronous Mermaid (≤ v9.3.0). See
references/markdown-helpers.md. - The legacy
!>/?>callouts and thethemeColor/topMarginoptions are deprecated in v5 — prefer GitHub-style> [!NOTE]callouts and CSS variables.
Assets
assets/index.html— production-readyindex.htmltemplate with comments showing where to enable theme add-ons and plugins. Copy and edit; do not load into the conversation context unless modifying the template itself.