Thank you for your interest in improving P2 documentation! This guide will help you contribute effectively.
We welcome contributions that:
- Improve technical accuracy
- Add missing documentation
- Enhance clarity and readability
- Provide working code examples
- Fix errors or inconsistencies
- Add learning resources
- Fork the repository
- Create a feature branch:
git checkout -b feat/your-feature-name - Make your changes following our standards
- Test any code examples on real P2 hardware
- Commit with clear messages
- Push to your fork
- Submit a Pull Request
- Be Clear: Use simple, direct language
- Be Complete: Include all necessary information
- Be Correct: Verify technical accuracy
- Be Consistent: Follow existing terminology
- Be Concise: Avoid unnecessary verbosity
All technical documentation MUST be:
- ✅ Verified against official P2 documentation
- ✅ Tested on actual P2 hardware (for code examples)
- ✅ Reviewed by someone familiar with the topic
- ✅ Include version information where relevant
# Title (One H1 per document)
## Section (H2 for main sections)
### Subsection (H3 for subsections)
**Bold** for emphasis
*Italic* for first use of technical terms
`code` for inline codeAlways specify the language:
```spin2
PUB main() | i
repeat i from 0 to 9
debug(udec(i))
```
```pasm2
org 0
mov x, #5
add x, #3
```Use tables for structured information:
| Instruction | Cycles | Description |
|------------|--------|-------------|
| NOP | 2 | No operation |
| MOV | 2 | Move data |For JSON files in /ai-reference/:
{
"$schema": "version-url",
"metadata": {
"version": "1.0.0",
"lastUpdated": "2024-01-15",
"contributors": ["name"]
},
"content": {
// Actual data here
}
}When adding new documentation:
- Check it doesn't already exist
- Place it in the correct section
- Follow the document template
- Update the INDEX.md file
- Add cross-references where appropriate
For fixing errors:
- Clearly describe what was wrong
- Provide source for correct information
- Update all affected documents
- Test any corrected code
When contributing code:
- Test on real P2 hardware
- Include clear comments
- Follow P2 coding conventions
- Provide expected output
- Explain the concept being demonstrated
For educational content:
- Identify the target audience
- Start with prerequisites
- Build concepts progressively
- Include exercises with solutions
- Provide common mistake warnings
- Read existing documentation in the area
- Follow the style guide
- Test all code examples
- Run link checker (if modifying links)
- Update INDEX.md if adding new files
- Write clear commit messages
## Description
[What does this PR do?]
## Type of Change
- [ ] Bug fix (correction to existing documentation)
- [ ] New feature (new documentation)
- [ ] Enhancement (improvement to existing docs)
## Testing
- [ ] Code examples tested on P2 hardware
- [ ] Links verified
- [ ] JSON validates against schema
## Checklist
- [ ] Follows style guidelines
- [ ] Includes necessary cross-references
- [ ] Updates INDEX.md if needed
- [ ] Commits are logical and well-described- Automated Checks: JSON validation, link checking
- Technical Review: Accuracy verification
- Editorial Review: Style and clarity
- Merge: After approval from maintainer
- Text editor with Markdown support
- Git for version control
- Python 3.x for running tools
- (Optional) Propeller Tool for testing code
Run these before submitting:
# Check JSON validity
python tools/validate-json.py
# Verify internal links
python tools/check-links.py
# Generate updated index
python tools/generate-index.pyUse conventional commits:
docs: Add [topic] documentationfix: Correct [specific error]feat: Add [new feature/section]refactor: Reorganize [section]chore: Update [maintenance task]
Examples:
docs: Add smart pin UART configuration guide
fix: Correct WAITX instruction cycle count
feat: Add comprehensive CORDIC examples
refactor: Reorganize memory model section for clarity
# [Topic Name]
## Overview
[One paragraph description]
## Prerequisites
- [Required knowledge]
- [Required reading]
## Concept
[Main explanation]
## Implementation
[How to use/implement]
## Examples
[Working code examples]
## Common Pitfalls
[What to avoid]
## Best Practices
[Recommended approaches]
## Related Topics
- [Link to related doc]
## References
- [External sources]
## Metadata
- Version: 1.0.0
- Last Updated: YYYY-MM-DD
- Contributors: [Your Name]- Technical Questions: Open an issue with the "question" label
- Process Questions: See existing discussions
- General P2 Questions: Visit Parallax Forums
Contributors will be:
- Listed in the document metadata
- Mentioned in release notes
- Added to CONTRIBUTORS.md file
- Be respectful and inclusive
- Focus on technical merit
- Accept constructive feedback
- Help others learn
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for helping improve P2 documentation!