Documentation Contributions
Documentation is the unsung hero of open source. It's often the easiest way to start contributing while making a huge impact.
Why Docs Matter
60% of user issues stem from documentation problems!
Types of Documentation
Finding Doc Opportunities
Look For These Labels
| Label | Opportunity |
|---|---|
documentation | Docs needed |
good first issue + docs | Perfect for beginners |
help wanted | Often includes docs |
needs-docs | Feature lacks docs |
Common Documentation Gaps
- Missing installation steps for certain OS
- Outdated screenshots
- Broken links
- Typos and grammar errors
- Missing examples
- Unclear error messages
- Missing troubleshooting guides
- Outdated version numbers
Finding Gaps Yourself
Documentation Workflow
Writing Good Documentation
The Golden Rule
Write for someone who knows nothing about this project.
Documentation Structure
# Feature Name
One sentence explaining what this does.
## Overview
Brief explanation (2-3 sentences).
## Prerequisites
- What users need before starting
- Required dependencies
- Minimum versions
## Quick Start
Fastest way to get working.
## Detailed Usage
### Option 1: Common Case
Step-by-step with examples.
### Option 2: Advanced Case
For power users.
## Configuration
| Option | Default | Description |
|--------|---------|-------------|
| `timeout` | `30s` | Request timeout |
## Troubleshooting
### Common Issue 1
Cause and solution.
### Common Issue 2
Cause and solution.
## Related
- Links to related docsBefore and After
β Bad Documentation:
# Auth
Use the auth function to authenticate.
auth(credentials)
This will authenticate the user.β Good Documentation:
# Authentication
Authenticate users with the `auth()` function.
## Quick Start
```javascript
import { auth } from 'library';
const session = await auth({
email: 'user@example.com',
password: 'secure-password'
});
console.log(session.token); // JWT tokenParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
email | string | Yes | User's email address |
password | string | Yes | User's password |
remember | boolean | No | Keep session active (default: false) |
Returns
Returns a Session object:
{
token: 'eyJhbG...', // JWT authentication token
userId: '123', // User's unique ID
expiresAt: 1234567890 // Token expiration timestamp
}Errors
| Error | Cause | Solution |
|---|---|---|
InvalidCredentials | Wrong email/password | Verify credentials |
AccountLocked | Too many failed attempts | Wait 15 minutes |
Example: Full Implementation
import { auth, AuthError } from 'library';
async function login(email, password) {
try {
const session = await auth({ email, password });
localStorage.setItem('token', session.token);
return session;
} catch (error) {
if (error instanceof AuthError) {
console.error('Login failed:', error.message);
}
throw error;
}
}
### Key Principles
| Principle | Description |
|-----------|-------------|
| **Concise** | No unnecessary words |
| **Complete** | All needed information |
| **Correct** | Accurate and tested |
| **Current** | Up to date |
| **Consistent** | Same style throughout |
## Writing Code Examples
### Good Examples
```javascript
// β
Shows real use case
const user = await getUser('user-123');
console.log(`Welcome, ${user.name}!`);
// β Too abstract
const x = await fn(a);
console.log(x);Example Best Practices
- Use realistic values (not
foo,bar,test) - Show complete snippets that can be copy-pasted
- Include imports when relevant
- Add comments explaining non-obvious parts
- Show expected output when helpful
Common Documentation Formats
Markdown Essentials
# Heading 1
## Heading 2
### Heading 3
**bold** and *italic*
- Bullet point
- Another point
1. Numbered
2. List
`inline code`
code block (4 spaces)
```language
fenced code blockBlockquote

| Column 1 | Column 2 |
|---|---|
| Data | Data |
### Project-Specific Formats
| Format | Tools |
|--------|-------|
| Markdown | GitHub, GitLab, most projects |
| MDX | React projects, Docusaurus |
| reStructuredText | Python (Sphinx) |
| AsciiDoc | Some enterprise projects |
| YAML/JSON | API documentation |
## Types of Doc Contributions
### 1. Fixing Typos
Smallest but valuable!
```diff
- This function retuns a value
+ This function returns a valuePR title: docs: fix typo in auth.md
2. Improving Clarity
- Use the function to do stuff
+ Call `processData()` to validate and transform user input3. Adding Examples
## Usage
Call the function with your data.
+ ### Example
+
+ ```javascript
+ const result = processData({ name: 'John', age: 30 });
+ console.log(result); // { valid: true, processed: {...} }
+ ```4. Adding Missing Sections
## Installation
npm install library
+ ## Configuration
+
+ Create a config file in your project root:
+
+ ```javascript
+ // library.config.js
+ module.exports = {
+ option1: true,
+ option2: 'value'
+ };
+ ```5. Updating Outdated Docs
- ## Requires Node.js 14+
+ ## Requires Node.js 18+6. Adding Translations
Many projects need translations:
docs/
en/
getting-started.md
es/ # Spanish
getting-started.md
zh/ # Chinese
getting-started.mdDocumentation PR Checklist
Before submitting:
- Links work
- Code examples run
- Spelling/grammar checked
- Follows project style
- Screenshots current (if any)
- No broken images
- Table formatting correct
- Preview renders correctly
PR Message Template
## Description
[What docs are you changing and why]
## Type of Change
- [ ] Fix typo/grammar
- [ ] Improve clarity
- [ ] Add missing content
- [ ] Update outdated content
- [ ] Add examples
- [ ] Other: [describe]
## Checklist
- [ ] I've read the contributing guide
- [ ] I've previewed my changes
- [ ] Links are working
- [ ] Code examples are correctDocumentation Tools
Spell Checking
# npm
npm install -g cspell
cspell "docs/**/*.md"
# VSCode extension: Code Spell CheckerLink Checking
# Check for broken links
npm install -g markdown-link-check
find docs -name "*.md" -exec markdown-link-check {} \;Previewing
# For markdown
npm install -g markdown-preview
# For Docusaurus
npm run start
# For MkDocs
mkdocs serveImpact of Doc Contributions
Real Impact Stats
| Metric | Impact |
|---|---|
| Good README | 50%+ more stars |
| Clear setup guide | 70% less setup issues |
| API examples | 40% faster adoption |
| Troubleshooting docs | 60% fewer support requests |
Documentation Issues to Look For
Perfect First Contributions
- Typos - Easy fix, immediate merge
- Broken links - Quick to fix and verify
- Outdated versions - Check current versions
- Missing OS instructions - Add Windows/Mac/Linux
- Screenshot updates - Take new screenshots
Medium Contributions
- Add code examples - For existing features
- Improve explanations - Make unclear docs clearer
- Add FAQ entries - Based on common issues
- Create troubleshooting guide - Document error fixes
Large Contributions
- Write tutorials - Step-by-step guides
- Create architecture docs - System overview
- Add API documentation - Full reference
- Translate docs - New language support
Building a Portfolio
Documentation contributions showcase:
- β Communication skills - Can explain complex topics
- β User empathy - Understand beginner perspective
- β Attention to detail - Catch errors others miss
- β Technical understanding - Must understand to document
Highlighting Doc Work
## Open Source Contributions
**Documentation Lead** - [Project Name]
- Rewrote getting started guide, reducing setup issues by 40%
- Added 15 code examples to API documentation
- Translated documentation to Spanish (3,000+ words)Quick Reference
Doc PR Titles
docs: fix typo in README
docs: add installation example for Windows
docs(api): add authentication examples
docs: update Node.js version requirement
docs(contributing): clarify PR processFinding Doc Issues
# GitHub search
repo:org/repo is:issue is:open label:documentation
repo:org/repo is:issue is:open label:good-first-issue label:docsNext Steps
You've completed the First Contribution section! Move on to advanced topics:
β‘οΈ Issues & Pull Requests β
Pro tip: Many of the best contributors started with documentation. It's not "lesser" workβit's essential work that maintainers deeply appreciate.