|
| 1 | +# Contributing to SyntaxKit Documentation |
| 2 | + |
| 3 | +This guide establishes standards and processes for reviewing and contributing to SyntaxKit's documentation. |
| 4 | + |
| 5 | +## Documentation Types |
| 6 | + |
| 7 | +SyntaxKit uses several types of documentation that require different review approaches: |
| 8 | + |
| 9 | +### 1. DocC Documentation |
| 10 | +- **API Documentation**: Inline code documentation (`///` comments) |
| 11 | +- **Tutorials**: Step-by-step guides in `/Documentation.docc/Tutorials/` |
| 12 | +- **Articles**: Conceptual guides in `/Documentation.docc/Articles/` |
| 13 | +- **Landing Page**: Main documentation overview (`Documentation.docc/Documentation.md`) |
| 14 | + |
| 15 | +### 2. Repository Documentation |
| 16 | +- **README.md**: Project overview and quick start |
| 17 | +- **CLAUDE.md**: AI assistant context and development guidelines |
| 18 | +- **Contributing guides**: This file and related contribution documentation |
| 19 | + |
| 20 | +## Documentation Review Checklist |
| 21 | + |
| 22 | +### For ALL Documentation Changes |
| 23 | + |
| 24 | +#### ✅ Completeness |
| 25 | +- [ ] All sections are complete and no placeholders remain |
| 26 | +- [ ] Code examples are complete and functional |
| 27 | +- [ ] Cross-references to related documentation are included |
| 28 | +- [ ] Prerequisites and requirements are clearly stated |
| 29 | + |
| 30 | +#### ✅ Accuracy |
| 31 | +- [ ] All code examples compile and run successfully |
| 32 | +- [ ] Swift syntax is correct and follows current language version |
| 33 | +- [ ] API references are accurate and up-to-date |
| 34 | +- [ ] Version compatibility information is current |
| 35 | +- [ ] External links are valid and working |
| 36 | + |
| 37 | +#### ✅ Clarity & Writing Quality |
| 38 | +- [ ] Content is clearly written and easy to understand |
| 39 | +- [ ] Technical jargon is explained or avoided when possible |
| 40 | +- [ ] Headings and structure provide good content hierarchy |
| 41 | +- [ ] Sentences are concise and well-constructed |
| 42 | +- [ ] Grammar and spelling are correct |
| 43 | + |
| 44 | +#### ✅ Consistency |
| 45 | +- [ ] Follows SyntaxKit documentation style guide |
| 46 | +- [ ] Code formatting matches project conventions |
| 47 | +- [ ] Terminology is consistent across documentation |
| 48 | +- [ ] Cross-references use proper DocC link syntax |
| 49 | + |
| 50 | +### For DocC Tutorials |
| 51 | + |
| 52 | +#### ✅ Tutorial Structure |
| 53 | +- [ ] Clear learning objectives stated upfront |
| 54 | +- [ ] Estimated completion time provided |
| 55 | +- [ ] Prerequisites clearly listed |
| 56 | +- [ ] Step-by-step progression is logical |
| 57 | + |
| 58 | +#### ✅ Code Examples |
| 59 | +- [ ] All code examples are tested and working |
| 60 | +- [ ] Examples build incrementally toward final goal |
| 61 | +- [ ] Complete working examples are provided |
| 62 | +- [ ] Code includes appropriate comments and explanations |
| 63 | + |
| 64 | +#### ✅ User Experience |
| 65 | +- [ ] Tutorial can be completed in stated time frame |
| 66 | +- [ ] Each step produces visible, meaningful progress |
| 67 | +- [ ] "Aha moments" and key insights are highlighted |
| 68 | +- [ ] Next steps and related content are provided |
| 69 | + |
| 70 | +### For DocC Articles |
| 71 | + |
| 72 | +#### ✅ Content Organization |
| 73 | +- [ ] Article has clear scope and purpose |
| 74 | +- [ ] Content is organized with proper headings |
| 75 | +- [ ] Complex topics are broken into digestible sections |
| 76 | +- [ ] Related articles are cross-referenced |
| 77 | + |
| 78 | +#### ✅ Technical Depth |
| 79 | +- [ ] Appropriate level of technical detail for audience |
| 80 | +- [ ] Best practices and anti-patterns are clearly identified |
| 81 | +- [ ] Performance considerations are addressed when relevant |
| 82 | +- [ ] Error handling and troubleshooting guidance included |
| 83 | + |
| 84 | +### For API Documentation |
| 85 | + |
| 86 | +#### ✅ Documentation Comments |
| 87 | +- [ ] All public APIs have documentation comments |
| 88 | +- [ ] Parameter descriptions are clear and complete |
| 89 | +- [ ] Return value descriptions explain purpose and type |
| 90 | +- [ ] Throws documentation lists possible errors |
| 91 | +- [ ] Examples demonstrate typical usage patterns |
| 92 | + |
| 93 | +#### ✅ Code Examples in Comments |
| 94 | +- [ ] Code examples in doc comments compile correctly |
| 95 | +- [ ] Examples show realistic usage scenarios |
| 96 | +- [ ] Complex APIs include multiple usage examples |
| 97 | +- [ ] Examples follow Swift API design guidelines |
| 98 | + |
| 99 | +## Review Process |
| 100 | + |
| 101 | +### For Documentation Contributors |
| 102 | + |
| 103 | +1. **Before Submitting PR** |
| 104 | + - [ ] Run through the complete review checklist |
| 105 | + - [ ] Test all code examples in a clean environment |
| 106 | + - [ ] Generate DocC documentation locally to verify rendering |
| 107 | + - [ ] Proofread for grammar, spelling, and clarity |
| 108 | + |
| 109 | +2. **PR Description Requirements** |
| 110 | + - [ ] Clearly describe documentation changes made |
| 111 | + - [ ] Explain motivation for changes or new content |
| 112 | + - [ ] List any dependencies on code changes |
| 113 | + - [ ] Include screenshots for visual/layout changes |
| 114 | + |
| 115 | +### For Documentation Reviewers |
| 116 | + |
| 117 | +1. **Initial Review** |
| 118 | + - [ ] Verify PR follows the documentation review checklist |
| 119 | + - [ ] Check that all required information is provided |
| 120 | + - [ ] Identify any missing or incomplete sections |
| 121 | + |
| 122 | +2. **Technical Review** |
| 123 | + - [ ] Verify all code examples compile and run |
| 124 | + - [ ] Check accuracy of API references and technical details |
| 125 | + - [ ] Test tutorial steps in clean environment |
| 126 | + - [ ] Validate external links and cross-references |
| 127 | + |
| 128 | +3. **Content Review** |
| 129 | + - [ ] Assess clarity and readability for target audience |
| 130 | + - [ ] Check consistency with existing documentation style |
| 131 | + - [ ] Verify logical flow and organization |
| 132 | + - [ ] Suggest improvements for user experience |
| 133 | + |
| 134 | +4. **Final Approval Requirements** |
| 135 | + - [ ] All checklist items addressed satisfactorily |
| 136 | + - [ ] Code examples tested and confirmed working |
| 137 | + - [ ] Content meets SyntaxKit quality standards |
| 138 | + - [ ] Changes align with project goals and direction |
| 139 | + |
| 140 | +## Documentation Quality Standards |
| 141 | + |
| 142 | +### Writing Style |
| 143 | +- **Tone**: Professional but approachable, avoid overly casual language |
| 144 | +- **Voice**: Use active voice when possible |
| 145 | +- **Perspective**: Write from the user's perspective, focus on their goals |
| 146 | +- **Complexity**: Start simple, build complexity gradually |
| 147 | + |
| 148 | +### Code Examples |
| 149 | +- **Completeness**: Examples should be complete and runnable |
| 150 | +- **Relevance**: Examples should solve real-world problems |
| 151 | +- **Progression**: Build from simple to complex examples |
| 152 | +- **Comments**: Include explanatory comments for complex logic |
| 153 | + |
| 154 | +### Structure Requirements |
| 155 | +- **Headings**: Use semantic heading hierarchy (H1 → H2 → H3) |
| 156 | +- **Lists**: Use bullet points for unordered items, numbers for sequences |
| 157 | +- **Links**: Use descriptive link text, avoid "click here" or bare URLs |
| 158 | +- **Code Blocks**: Always specify language for syntax highlighting |
| 159 | + |
| 160 | +## Common Documentation Issues |
| 161 | + |
| 162 | +### ❌ Issues to Avoid |
| 163 | +- Placeholder text or incomplete sections |
| 164 | +- Code examples that don't compile or run |
| 165 | +- Broken internal or external links |
| 166 | +- Inconsistent terminology across documentation |
| 167 | +- Missing context or assumptions about user knowledge |
| 168 | +- Overly complex examples for introductory content |
| 169 | +- Documentation that contradicts actual API behavior |
| 170 | +- Missing error handling in code examples |
| 171 | + |
| 172 | +### ✅ Best Practices |
| 173 | +- Test all code examples in isolation |
| 174 | +- Include both simple and advanced examples |
| 175 | +- Provide context for when to use different approaches |
| 176 | +- Link to related documentation and external resources |
| 177 | +- Use consistent formatting and structure |
| 178 | +- Include troubleshooting guidance for common issues |
| 179 | +- Show both success and error handling scenarios |
| 180 | +- Keep examples focused and purposeful |
| 181 | + |
| 182 | +## Tools and Validation |
| 183 | + |
| 184 | +### Required Checks Before Approval |
| 185 | +1. **Compilation**: All Swift code examples must compile |
| 186 | +2. **Link Validation**: All links must resolve correctly |
| 187 | +3. **DocC Generation**: Documentation must build without warnings |
| 188 | +4. **Spelling/Grammar**: Use spell check and grammar validation |
| 189 | +5. **Consistency**: Verify consistency with existing documentation |
| 190 | + |
| 191 | +### Local Testing Commands |
| 192 | +```bash |
| 193 | +# Generate DocC documentation locally |
| 194 | +swift package generate-documentation |
| 195 | + |
| 196 | +# Run code quality checks (includes documentation linting) |
| 197 | +./Scripts/lint.sh |
| 198 | + |
| 199 | +# Test Swift code examples |
| 200 | +swift build && swift test |
| 201 | +``` |
| 202 | + |
| 203 | +## Reviewer Assignment |
| 204 | + |
| 205 | +### Primary Reviewers |
| 206 | +- **Technical Accuracy**: Maintainers or core contributors with deep SyntaxKit knowledge |
| 207 | +- **Documentation Quality**: Team members with strong writing and documentation skills |
| 208 | +- **User Experience**: Contributors who represent the target audience perspective |
| 209 | + |
| 210 | +### Review Timeline |
| 211 | +- **Simple Changes**: 1-2 business days |
| 212 | +- **New Tutorials/Articles**: 3-5 business days |
| 213 | +- **Major Documentation Overhauls**: 1-2 weeks |
| 214 | + |
| 215 | +## Continuous Improvement |
| 216 | + |
| 217 | +### Documentation Metrics |
| 218 | +- Documentation coverage for public APIs |
| 219 | +- User feedback on tutorial completion rates |
| 220 | +- Community questions that indicate documentation gaps |
| 221 | +- Time-to-productivity for new SyntaxKit users |
| 222 | + |
| 223 | +### Regular Maintenance |
| 224 | +- **Quarterly**: Review all documentation for accuracy and relevance |
| 225 | +- **Per Release**: Update version-specific information and compatibility notes |
| 226 | +- **As Needed**: Address community feedback and identified gaps |
| 227 | + |
| 228 | +This checklist ensures that SyntaxKit maintains high-quality, accurate, and user-friendly documentation that serves both new users learning the library and experienced developers seeking detailed reference information. |
0 commit comments