Welcome to the SpectrumLab documentation! This guide will help you contribute to our documentation system.
This documentation is built with VitePress, a static site generator designed for creating fast, beautiful documentation websites. Our documentation supports both English and Chinese languages to serve our global community.
Contributing to our documentation is straightforward! Simply clone the project, add or modify Markdown files, commit your changes, and create a Pull Request.
Before you begin, ensure you have the following installed:
git clone https://github.com/little1d/SpectrumLab.git
cd SpectrumLabNavigate to the docs directory and install the required dependencies:
cd docs
npm installAlternatively, if you prefer using the development dependencies globally:
npm add -D vitepress
npm installCreate a new branch for your documentation changes. We recommend using the naming convention docs/<section-name> (e.g., docs/api, docs/examples, docs/benchmarks).
git checkout -b docs/<your-section-name>For detailed branching and contribution guidelines, please refer to our Contributing Guide.
To start the development server and preview your changes in real-time:
npm run docs:devThis will start a local server (typically at http://localhost:5173) where you can preview your documentation changes.
If you need to test the complete compilation and packaging:
# Build the documentation
npm run docs:build
# Preview the production build
npm run docs:previewNote: These commands are configured in
docs/package.json. You can modify them if needed.
We have automated deployment set up using GitHub Actions. The deployment process is triggered automatically when:
- Changes are pushed to the
mainbranch - Changes are made to files in the
docs/directory - Changes are made to the deployment workflow file
All you need to do is create a Pull Request! Once your PR is merged into the main branch, the documentation will be automatically deployed to GitHub Pages.
Our documentation is organized as follows:
docs/
├── .vitepress/ # VitePress configuration
├── public/ # Static assets
├── assets/ # Documentation assets
├── en/ # English documentation
│ ├── index.md
│ ├── tutorial.md
│ ├── api.md
│ └── benchmark.md
├── zh/ # Chinese documentation
│ ├── index.md
│ ├── tutorial.md
│ ├── api.md
│ └── benchmark.md
├── index.md # Homepage
├── package.json # Dependencies and scripts
└── README.md # This file
- English: Primary language for the documentation
- Chinese: Full translation available for Chinese-speaking users
- Be Clear and Concise: Write in simple, clear language
- Use Code Examples: Include practical examples wherever possible
- Maintain Consistency: Follow the existing style and structure
- Cross-Reference: Link to related sections when appropriate
VitePress supports many Markdown features including:
- Code Blocks: With syntax highlighting
- Custom Containers: For tips, warnings, and notes
- Mathematical Expressions: Using LaTeX syntax
- Mermaid Diagrams: For flowcharts and diagrams
Example:
::: tip
This is a helpful tip!
:::
::: warning
This is a warning message.
:::
::: danger
This is a danger alert.
:::If you encounter any issues or have questions about contributing to the documentation:
- Check our existing issues
- Create a new issue with the
documentationlabel - Refer to the VitePress documentation for technical questions
- Review our Contributing Guide for general contribution guidelines
Thank you for contributing to SpectrumLab documentation! 🎉