290 lines
6.9 KiB
Markdown
290 lines
6.9 KiB
Markdown
# EasyBallistics Documentation
|
|
|
|
This directory contains the complete documentation for EasyBallistics, built with [Docusaurus](https://docusaurus.io/).
|
|
|
|
## 🚀 Quick Start
|
|
|
|
### Prerequisites
|
|
|
|
- **Node.js** 18.0 or higher
|
|
- **npm** or **yarn**
|
|
|
|
### Installation
|
|
|
|
```bash
|
|
cd docs
|
|
npm install
|
|
```
|
|
|
|
### Development
|
|
|
|
Start the development server:
|
|
|
|
```bash
|
|
npm start
|
|
```
|
|
|
|
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
|
|
|
|
### Build
|
|
|
|
Generate static content:
|
|
|
|
```bash
|
|
npm run build
|
|
```
|
|
|
|
This command generates static content into the `build` directory and can be served using any static contents hosting service.
|
|
|
|
## 📚 Documentation Structure
|
|
|
|
```
|
|
docs/
|
|
├── docs/ # Documentation content
|
|
│ ├── intro.md # Homepage/Introduction
|
|
│ ├── getting-started/ # Installation and quick start
|
|
│ ├── core-concepts/ # Fundamental concepts
|
|
│ ├── assets/ # Asset creation guides
|
|
│ ├── components/ # Component documentation
|
|
│ ├── mathematical/ # Mathematical ballistics
|
|
│ ├── networking/ # Multiplayer features
|
|
│ ├── performance/ # Optimization guides
|
|
│ ├── tutorials/ # Step-by-step tutorials
|
|
│ ├── api/ # API reference
|
|
│ ├── migration/ # Migration guides
|
|
│ ├── troubleshooting.md # Common issues
|
|
│ └── changelog.md # Version history
|
|
├── src/ # Custom React components
|
|
│ └── css/ # Custom styling
|
|
├── static/ # Static assets
|
|
│ └── img/ # Images and screenshots
|
|
├── docusaurus.config.js # Site configuration
|
|
├── sidebars.js # Navigation structure
|
|
└── package.json # Dependencies
|
|
```
|
|
|
|
## 🎨 Customization
|
|
|
|
### Styling
|
|
|
|
Custom CSS is located in `src/css/custom.css`. This includes:
|
|
- Color scheme customization
|
|
- Component-specific styles
|
|
- Responsive design adjustments
|
|
|
|
### Configuration
|
|
|
|
Main configuration is in `docusaurus.config.js`:
|
|
- Site metadata
|
|
- Navigation structure
|
|
- Theme configuration
|
|
- Plugin settings
|
|
|
|
### Components
|
|
|
|
Custom React components for enhanced documentation:
|
|
- Code examples with syntax highlighting
|
|
- Interactive API documentation
|
|
- Embedded demos and screenshots
|
|
|
|
## 📝 Content Guidelines
|
|
|
|
### Writing Style
|
|
|
|
- **Clear and Concise**: Use simple, direct language
|
|
- **Code Examples**: Include practical, working examples
|
|
- **Screenshots**: Add visual aids for UI-heavy sections
|
|
- **Cross-References**: Link to related documentation
|
|
|
|
### File Naming
|
|
|
|
- Use kebab-case for file names: `getting-started.md`
|
|
- Group related content in folders
|
|
- Keep URLs readable and SEO-friendly
|
|
|
|
### Markdown Features
|
|
|
|
Docusaurus supports enhanced markdown:
|
|
|
|
```markdown
|
|
:::info
|
|
Information callouts for important notes
|
|
:::
|
|
|
|
:::warning
|
|
Warning callouts for potential issues
|
|
:::
|
|
|
|
:::danger
|
|
Danger callouts for critical warnings
|
|
:::
|
|
|
|
```cpp title="Example.cpp"
|
|
// Code blocks with titles and syntax highlighting
|
|
void ExampleFunction()
|
|
{
|
|
// Implementation
|
|
}
|
|
```
|
|
|
|
```mermaid
|
|
graph TD
|
|
A[Start] --> B[Process]
|
|
B --> C[End]
|
|
```
|
|
```
|
|
|
|
## 🚢 Deployment
|
|
|
|
### GitHub Pages
|
|
|
|
Deploy to GitHub Pages:
|
|
|
|
```bash
|
|
npm run deploy
|
|
```
|
|
|
|
### Custom Hosting
|
|
|
|
Build and deploy to any static hosting service:
|
|
|
|
```bash
|
|
npm run build
|
|
# Upload the build/ directory to your hosting provider
|
|
```
|
|
|
|
### Continuous Integration
|
|
|
|
Example GitHub Actions workflow:
|
|
|
|
```yaml
|
|
name: Deploy Documentation
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths: ['docs/**']
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-node@v2
|
|
with:
|
|
node-version: '18'
|
|
- name: Install dependencies
|
|
run: cd docs && npm install
|
|
- name: Build documentation
|
|
run: cd docs && npm run build
|
|
- name: Deploy to GitHub Pages
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
publish_dir: ./docs/build
|
|
```
|
|
|
|
## 🤝 Contributing
|
|
|
|
### Documentation Contributions
|
|
|
|
1. **Fork the repository**
|
|
2. **Create a documentation branch**: `git checkout -b docs/feature-name`
|
|
3. **Make your changes** following the content guidelines
|
|
4. **Test locally**: `npm start` to preview changes
|
|
5. **Submit a pull request** with a clear description
|
|
|
|
### Content Types
|
|
|
|
We welcome contributions for:
|
|
- **Tutorials**: Step-by-step guides for specific use cases
|
|
- **Examples**: Code samples and implementation patterns
|
|
- **Troubleshooting**: Solutions to common problems
|
|
- **API Documentation**: Detailed function and class references
|
|
- **Screenshots**: Visual aids for complex procedures
|
|
|
|
### Review Process
|
|
|
|
All documentation changes go through:
|
|
1. **Technical Review**: Accuracy and completeness
|
|
2. **Editorial Review**: Grammar, style, and clarity
|
|
3. **Testing**: Verify examples and instructions work
|
|
4. **Deployment**: Merge and publish updates
|
|
|
|
## 🛠️ Development Tools
|
|
|
|
### Useful Commands
|
|
|
|
```bash
|
|
# Start development server
|
|
npm start
|
|
|
|
# Build for production
|
|
npm run build
|
|
|
|
# Serve production build locally
|
|
npm run serve
|
|
|
|
# Clear build cache
|
|
npm run clear
|
|
|
|
# Generate heading IDs
|
|
npm run write-heading-ids
|
|
|
|
# Extract translatable strings
|
|
npm run write-translations
|
|
```
|
|
|
|
### VS Code Extensions
|
|
|
|
Recommended extensions for documentation development:
|
|
- **Markdown All in One**: Enhanced markdown editing
|
|
- **Code Spell Checker**: Catch typos and spelling errors
|
|
- **Prettier**: Consistent code formatting
|
|
- **Auto Rename Tag**: HTML/JSX tag editing
|
|
|
|
## 📊 Analytics and Monitoring
|
|
|
|
### Google Analytics
|
|
|
|
Analytics are configured in `docusaurus.config.js`:
|
|
|
|
```javascript
|
|
gtag: {
|
|
trackingID: 'G-XXXXXXXXXX',
|
|
anonymizeIP: true,
|
|
}
|
|
```
|
|
|
|
### Search
|
|
|
|
Built-in search is provided by Algolia DocSearch:
|
|
|
|
```javascript
|
|
algolia: {
|
|
apiKey: 'your-api-key',
|
|
indexName: 'easyballistics',
|
|
contextualSearch: true,
|
|
}
|
|
```
|
|
|
|
## 🐛 Issues and Support
|
|
|
|
### Reporting Documentation Issues
|
|
|
|
When reporting documentation issues:
|
|
1. **Specify the page**: Include the URL or file path
|
|
2. **Describe the problem**: What's unclear or incorrect
|
|
3. **Suggest improvements**: How could it be better
|
|
4. **Provide context**: Your use case or scenario
|
|
|
|
### Getting Help
|
|
|
|
- **Discord**: [Real-time community support](https://discord.gg/easyballistics)
|
|
- **GitHub Issues**: [Report documentation bugs](https://github.com/your-org/easyballistics/issues)
|
|
- **Email**: docs@easyballistics.com
|
|
|
|
## 📄 License
|
|
|
|
Documentation is licensed under [Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/).
|
|
|
|
Code examples within the documentation follow the same license as the EasyBallistics plugin. |