* Initial plan * Add OpenAPI documentation for privacy, plugins, and admin routes Co-authored-by: onnwee <211922112+onnwee@users.noreply.github.com> * Add comprehensive API documentation guides with code examples Co-authored-by: onnwee <211922112+onnwee@users.noreply.github.com> * Add API documentation index and update main README Co-authored-by: onnwee <211922112+onnwee@users.noreply.github.com> * Add comprehensive API documentation portal implementation summary Co-authored-by: onnwee <211922112+onnwee@users.noreply.github.com> * Fix broken documentation links Co-authored-by: onnwee <211922112+onnwee@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: onnwee <211922112+onnwee@users.noreply.github.com>
Spywatcher Documentation
This directory contains the comprehensive documentation for Spywatcher, built with VitePress.
Documentation Structure
docs/
├── .vitepress/ # VitePress configuration
│ └── config.ts # Site configuration
├── guide/ # User guides
│ ├── index.md # Guide home
│ ├── installation.md # Installation guide
│ ├── quick-start.md # Quick start guide
│ └── ... # Feature guides
├── admin/ # Administrator guides
│ ├── index.md # Admin home
│ └── ... # Admin documentation
├── developer/ # Developer guides
│ ├── index.md # Developer home
│ └── ... # Development docs
├── api/ # API reference
│ ├── index.md # API home
│ └── ... # API endpoints
├── index.md # Documentation homepage
└── changelog.md # Version history
Local Development
Prerequisites
- Node.js 18+
- npm 8+
Setup
# Install dependencies (from repository root)
npm install
# Start development server
npm run docs:dev
The documentation will be available at http://localhost:5173/.
Build
# Build documentation
npm run docs:build
# Preview build
npm run docs:preview
Writing Documentation
Creating New Pages
- Create a new
.mdfile in the appropriate directory - Add front matter if needed
- Update
.vitepress/config.tsto add it to navigation - Use markdown with VitePress enhancements
Markdown Features
VitePress supports:
- Standard markdown
- Custom containers (tip, warning, danger)
- Code syntax highlighting
- Mermaid diagrams
- Vue components
Example Page
# Page Title
Brief introduction to the topic.
## Section
Content with **bold** and *italic* text.
### Code Example
\`\`\`typescript
// TypeScript code example
const example = "highlighted code";
\`\`\`
::: tip
Helpful tip for users
:::
::: warning
Important warning
:::
## Related
- [Related Page 1](./page1)
- [Related Page 2](./page2)
Custom Containers
::: tip
Helpful information
:::
::: warning
Important warnings
:::
::: danger
Critical information
:::
::: info
Informational content
:::
Code Groups
::: code-group
\`\`\`typescript [TypeScript]
const example = "TypeScript";
\`\`\`
\`\`\`python [Python]
example = "Python"
\`\`\`
:::
Deploying Documentation
GitHub Pages
Documentation can be deployed to GitHub Pages:
# Build documentation
npm run docs:build
# Deploy to GitHub Pages
# (Configure in .github/workflows/deploy-docs.yml)
Other Platforms
The built documentation (in docs/.vitepress/dist) can be deployed to:
- Netlify
- Vercel
- AWS S3
- Any static hosting service
Contributing
When contributing documentation:
- Follow the existing structure
- Use clear, concise language
- Include code examples
- Add screenshots for UI features
- Link to related documentation
- Test locally before submitting
See Contributing Guide for more details.
Style Guide
Writing Style
- Use active voice
- Write in second person ("you")
- Keep sentences short
- Use bullet points for lists
- Include examples
Formatting
- Use proper markdown headings (h1, h2, h3)
- Code snippets should be properly highlighted
- Use tables for structured data
- Add alt text to images
- Use consistent terminology
Code Examples
- Include complete, working examples
- Add comments to explain complex code
- Show both TypeScript and JavaScript when applicable
- Include error handling
- Use realistic variable names
Search
VitePress includes built-in search functionality. All content is automatically indexed.
Version Control
Documentation is version-controlled alongside code:
- Update docs in the same PR as code changes
- Keep docs in sync with features
- Update changelog for documentation changes
Links
Questions?
If you have questions about documentation:
- Open an issue on GitHub
- Check the Contributing Guide
- Review the Developer Guide