We welcome contributions from the community! This guide will help you get started with contributing to CodeVideoRenderer.
There are many ways to contribute:
- Bug Reports: Report issues you encounter
- Feature Requests: Suggest new features or improvements
- Code Contributions: Submit pull requests with code changes
- Documentation: Improve documentation and examples
- Testing: Help test new features and report bugs
- Community Support: Help other users in discussions
-
Fork the repository on GitHub
-
Clone your fork:
git clone https://github.com/ExploreMaths/CodeVideoRenderer.git cd CodeVideoRenderer -
Set up development environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -e .[dev]
-
Install pre-commit hooks:
pre-commit install
- Follow PEP 8 conventions
- Use type hints for all function signatures
- Write docstrings for all public functions and classes
- Keep functions focused and modular
Example:
def calculate_line_height(font_size: int, line_spacing: float) -> float:
"""Calculate line height based on font size and spacing.
Args:
font_size: The font size in points
line_spacing: The line spacing multiplier
Returns:
The calculated line height
"""
return font_size * line_spacing- Use reStructuredText for documentation
- Include examples for all public APIs
- Keep documentation up to date with code changes
- Use meaningful commit messages
- Write tests for new features and bug fixes
- Use pytest for testing framework
- Aim for good test coverage
- Include both unit tests and integration tests
Example test:
def test_camera_follow_cursor():
"""Test camera follows cursor correctly."""
video = CameraFollowCursorCV(('string', 'print("test")'), 'python')
# Test implementation
assert video.camera_behavior is not None# Run all tests
pytest
# Run with coverage
pytest --cov=CodeVideoRenderer
# Run specific test file
pytest tests/test_renderer.py-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes and commit them:
git add . git commit -m "Add feature: your feature description"
-
Push to your fork:
git push origin feature/your-feature-name
-
Create a Pull Request on GitHub
- One feature per PR: Keep pull requests focused
- Descriptive title: Clearly describe what the PR does
- Detailed description: Explain the changes and why they're needed
- Reference issues: Link to related issues
- Update documentation: Include documentation changes if needed
When reporting issues, please include:
- CodeVideoRenderer version
- Python version
- Operating system
- Error message and stack trace
- Steps to reproduce the issue
- Expected behavior vs actual behavior
Example issue template:
## Description
Brief description of the issue
## Steps to Reproduce
1. Step one
2. Step two
3. Step three
## Expected Behavior
What you expected to happen
## Actual Behavior
What actually happened
## Environment
- CodeVideoRenderer version: X.X.X
- Python version: X.X.X
- OS: Windows/macOS/LinuxWhen suggesting new features:
- Explain the problem you're trying to solve
- Describe your proposed solution
- Provide use cases and examples
- Consider alternatives you've explored
- Be respectful and inclusive
- Help others when you can
- Provide constructive feedback
Contributors will be recognized in:
- GitHub contributors list
- Release notes
- Documentation credits
If you need help with contributing:
- Check existing documentation and issues
- Ask in GitHub discussions
- Join the community chat (if available)
- Contact maintainers for guidance