Local development setup
Set up a local development environment to preview your changes, work across multiple files, and test documentation builds.
When to use local development
Use local development when:
- Making changes across multiple files
- Writing substantial new content
- Adding complex formatting or components
- Testing documentation builds
- Running automated checks before submitting
For quick fixes (typos, small wording changes), use the browser-based workflow instead.
System requirements
- Node.js version 22 or later
- Git for version control
- VS Code recommended as code editor
- Vale (optional) for style checking
- Command line access (Terminal)
Check your Node.js version
Should show v22.0.0 or higher.
Fork and clone the repository
1. Fork the repository
- Go to https://github.com/doc-detective/doc-detective.github.io.
- Click Fork in the top right.
- Select your GitHub account as the destination.
2. Clone your fork
3. Add upstream remote
This lets you sync with the main repository:
Verify remotes:
Should show:
Install dependencies
Choose the option that works best for you:
Option 1: Dev Container (recommended for consistency)
Use VS Code Dev Containers for a zero-config environment:
Prerequisites
Steps
- Fork and clone the repository (see steps below)
- Open in VS Code
- Reopen in Container:
- Press
F1orCmd/Ctrl+Shift+P - Select “Dev Containers: Reopen in Container”
- Wait for container to build (first time takes 5-10 minutes)
- Press
- Start the dev server:
Everything is pre-configured and ready to go.
Option 2: Local installation
Install dependencies directly on your machine:
- Fork and clone the repository (see steps below).
- Install dependencies:
Working locally
Start the development server:
The documentation site opens at http://localhost:3000 with live reload. Changes appear instantly as you edit files.
To make changes,
-
Create a branch:
Use descriptive branch names:
add-tutorial-X,fix-broken-links,document-feature-Y -
Edit files:
- Documentation files are in
docs/ - Edit in your preferred code editor
- Save and see changes live at
http://localhost:3000
- Documentation files are in
-
Commit regularly:
Build the site
Before submitting, verify the production build works:
This runs the full build process including:
- Schema generation
- Production optimization
- Link checking
- Build verification
Fix any errors before submitting your PR.
Preview the production build
View the production build at http://localhost:3000.
Run automated checks
Style checking with Vale
Vale enforces the documentation style guide.
Interpret results:
- Error: Should be fixed
- Warning: Strongly consider fixing
- Suggestion: Optional improvement
Don’t worry about fixing every suggestion. Reviewers use their judgment during reviews.
Common tasks
Add a new documentation page
-
Create the file:
-
Add front matter:
-
Update the navigation (if needed):
Edit
sidebars.tsto add your page to navigation.
Add images
-
Place images in
static/img/: -
Reference images in docs with paths relative to
static:
Add code examples
Use fenced code blocks with language identifiers:
Troubleshooting
Port 3000 already in use
Stop other development servers or use a different port:
Build fails with module errors
Clear cache and reinstall:
Changes aren’t appearing
Hard refresh your browser:
- Windows/Linux:
Ctrl+Shift+R - macOS:
Cmd+Shift+R
Or restart the dev server:
Vale can’t find its configuration
Make sure you’re running Vale from the repository root:
npm install fails
-
Check Node.js version:
If needed, update Node.js.
-
Clear npm cache:
Git workflows
Sync with upstream
Before starting new work, sync with the main repository:
Create a feature branch
Always work on a branch, not main:
Commit changes
Make small, focused commits:
Push changes
Create a pull request (on GitHub)
- Go to your fork on GitHub.
- Click Compare & pull request.
- Fill out the PR template.
- Click Create pull request.
See Standard changes or Substantial changes for PR guidelines.
Development tips
Use snippets
Create editor snippets for common patterns:
VS Code → Settings → User Snippets → markdown.json:
Watch for common mistakes
- Wrong file extension: Use
.mdx, not.md. - Missing front matter: All docs need title, description, etc.
- Wrong link format: Use
/docs/path, not./pathor../path. - Unescaped special characters: Escape
<,>,{,}in text.
Use VS Code extensions
Recommended extensions include
- MDX: Syntax highlighting for
.mdxfiles - Vale: Inline style checking
- Code Spell Checker: Catch typos
- Markdown All in One: Formatting tools
Next steps
Now that your environment is set up, you’re ready to contribute.
Questions? Ask in Discord.
Happy documenting. 📝