Serve a docs site locally with DocsifyJS
Choose an option below depending on whether you want to install and run Docsify CLI (optional), or use another server. Either way, you serve the docs
directory.
Docsify CLI
- Install NodeJS.
- Install Docsify CLI
- Global, or
npm install docsify-cli --global
- Project level.
Add to
npm init npm install docsify-cli
package.json
:"scripts": { "start": "docsify serve docs" }
- Global, or
- Run
- Global.
docsify serve docs
- Project level.
npm start
- Global.
Python web server
This approach works without Docsify CLI.
The main draw backs are no hot-reload of the browser on file changes and you need to open the browser console and disable cache, to ensure you get the latest content.
- Install Python 3.
- Follow gist.
- Run
(cd docs && python3 -m http.server 3000)
Other
Pick another web server quickstart from this gist.
Or use VS Code's Live Server - this may take configuration to ensure you serve from docs
and not root, otherwise your links will break.
Then open in the browser:
Note: DocsifyJS provides a convenient but optional CLI. It helps you create and serve a DocsifyJS project. In particular, it provides hot-reloading by default when using the server so that an an open localhost webpage will refresh when project files are saved.