Visual Studio Code Extension
DocsForge provides a VS Code extension for writing, previewing, and building documentation without leaving your editor.
Installation
From GitHub Releases (Recommended)
- Download the latest
.vsixfile from the GitHub Releases page - In VS Code, open Extensions (
Ctrl+Shift+X) - Click the ... (More Actions) menu → Install from VSIX...
- Select the downloaded
.vsixfile
From VSIX (Manual)
# Install via command line
code --install-extension docsforge-vscode-*.vsix
Prerequisites
- VS Code 1.99+
- Python 3.10+ with
docsforgeinstalled:
pip install docsforge
Getting Started
1. Open a DocsForge project
Open a folder containing a docsforge.yml file. The extension activates automatically and prompts:
"DocsForge project detected. Start dev server?"
Select "Yes" to start the dev server immediately, or use the sidebar later.
2. Create a new project
If you don't have a project yet:
- Click the DocsForge icon in the activity bar (left sidebar)
- Click Initialize Project
- Follow the wizard: site name, description, theme color, language, privacy mode, etc.
- The project is created in your workspace root
Features
Sidebar Actions
The DocsForge sidebar appears in the activity bar and shows contextual actions:
| Action | When | What it does |
|---|---|---|
| Start Server | Server stopped | Starts docsforge serve --no-open in the workspace |
| Stop Server | Server running | Stops the running dev server |
| Build | Always | Runs docsforge build and shows output in the channel |
| Open Preview | Server running | Opens the site in VS Code's built-in browser |
| Initialize Project | Always | Creates a new DocsForge project interactively |
Status Bar
The status bar shows the current server state:
▶ DocsForge: stopped— Click to start the server▶ DocsForge: starting...— Server is starting up▶ DocsForge: http://localhost:8000— Server is running. Click to open preview
Dev Server
The extension runs docsforge serve --no-open in the background:
- Output streams to the DocsForge output channel (
Ctrl+Shift+U→ select "DocsForge") - A progress notification shows "Starting DocsForge server..." until the URL is detected
- When the server is ready, the URL appears in the status bar
- VS Code's built-in browser handles navigation and hot-reload
Preview
Click Open Preview to see your site in VS Code's Simple Browser. This is VS Code's Electron-based browser — it supports all feature navigation, search, and page transitions.
Build
Click Build to run docsforge build. Output streams to the DocsForge channel. A notification shows the result.
Configuration
Settings
| Setting | Default | Description |
|---|---|---|
docsforge.pythonPath | "python" | Python interpreter path. Use "python3" on systems where python isn't Python 3 |
docsforge.lan | false | Serve on all interfaces (0.0.0.0) instead of localhost only |
docsforge.openBrowser | true | Open the site in VS Code's Simple Browser when the server starts |
Example: Configuring Python Path
If you use a virtual environment or a non-default Python:
{
"docsforge.pythonPath": "/home/user/.venv/bin/python"
}
Or via .vscode/settings.json in your project:
{
"docsforge.pythonPath": ".venv/bin/python"
}
Workflows
Edit → Preview Loop
- Start Server from the sidebar
- Click Open Preview when it's ready
- Edit your Markdown files
- The preview auto-reloads on save
- Stop Server when done
Build → Deploy
- Build from the sidebar
- Check the output for any errors
- The built site is in
site/— deploy anywhere
Initialize → Develop → Deploy
- Initialize Project — creates the project structure
- Start Server — preview and iterate
- Build — production build
- Deploy
site/to your hosting platform
Troubleshooting
| Issue | Fix |
|---|---|
| "Failed to run python" | Set docsforge.pythonPath to the correct Python binary |
| "No docsforge.yml found" | Run Initialize Project first, or create a docsforge.yml manually |
| Preview shows blank page | Check the DevTools console in VS Code (Help → Toggle Developer Tools) |
| Server won't start | Open the DocsForge output channel (Ctrl+Shift+U) for error details |
| "python: command not found" | Install Python 3.10+ from python.org |
Commands
All available commands (accessible via Ctrl+Shift+P):
| Command | Description |
|---|---|
DocsForge: Initialize Project | Create a new docsforge project |
DocsForge: Start Dev Server | Start the development server |
DocsForge: Stop Dev Server | Stop the development server |
DocsForge: Build | Build the documentation |
DocsForge: Open in VS Code Browser | Open the preview |
DocsForge: Refresh | Refresh the sidebar |
From GitHub Releases
Download the latest .vsix from the GitHub Releases page, then:
Extensions → … → Install from VSIX… → select the file
Prerequisites
Check the GitHub Releases for new versions. The release includes both the Python package and the .vsix file. Extension version matches the main package version.
Next Steps
- Usage Guide — Day-to-day DocsForge usage
- Deployment Guide — Deploy your site after building
- Features — All core features