Technical Documentation with Markdown: Complete Style Guide
Professional standards for writing developer documentation, API references, and technical guides
💡 Quick Start
Use our Markdown Formatter to write and preview technical documentation with live rendering. Also see our GitHub Markdown Guide.
Why Markdown for Technical Documentation?
Markdown has become the industry standard for technical documentation because it's:
- Version Control Friendly: Plain text works perfectly with Git
- Developer-Friendly: Write docs in the same tools as code
- Portable: No vendor lock-in, works everywhere
- Fast to Write: No GUI overhead, just type
- Easy to Review: Clean diffs in pull requests
- Static Site Ready: Converts to beautiful websites (Docusaurus, MkDocs, VuePress)
Document Structure Standards
1. README.md Structure
Every project needs a great README. Here's the professional standard:
# Project Name

[](link)
[](LICENSE)
[](releases)
One sentence describing what this project does.
## Features
- ✅ Feature 1 with emoji for visual appeal
- ✅ Feature 2
- 🚀 Feature 3
## Installation
```bash
npm install project-name
# or
yarn add project-name
```
## Quick Start
```javascript
import { Something } from 'project-name';
const result = Something.doThing();
console.log(result);
```
## Documentation
See [full documentation](https://docs.example.com)
## API Reference
### `doThing(options)`
Description of what this function does.
**Parameters:**
- `options` (Object) - Configuration object
- `option1` (string) - Description
- `option2` (boolean, optional) - Description
**Returns:** Description of return value
**Example:**
```javascript
const result = doThing({ option1: 'value' });
```
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md)
## License
MIT © [Your Name](https://github.com/yourusername)
## Support
- [Documentation](https://docs.example.com)
- [Issue Tracker](https://github.com/user/repo/issues)
- [Discord Community](https://discord.gg/example)2. Heading Hierarchy Rules
Proper heading structure is critical for navigation and accessibility:
✅ Correct Hierarchy
# Main Title (H1) - Only ONE per document ## Section (H2) ### Subsection (H3) #### Detail (H4) ## Another Section (H2) ### Another Subsection (H3)
❌ Incorrect Hierarchy
# Title #### Skipped levels - BAD! # Multiple H1s - BAD! ## Section ##### Jumped from H2 to H5 - BAD!
Rules:
- One H1 per document (the title)
- Don't skip heading levels (H2 → H4)
- Headings should describe content, not style ("Installation" not "Big Text")
- Keep headings concise (under 60 characters)
Code Block Best Practices
1. Always Specify Language
Language tags enable syntax highlighting and help readers understand context:
❌ Bad (no language)
```
function hello() {
console.log('Hello');
}
```✅ Good (with language)
```javascript
function hello() {
console.log('Hello');
}
```2. Common Language Tags
```javascript // JavaScript ```typescript // TypeScript ```python // Python ```bash // Bash/shell commands ```json // JSON data ```yaml // YAML config ```sql // SQL queries ```html // HTML ```css // CSS ```diff // Git diffs ```plaintext // Plain text (no highlighting)
3. Code Comments for Clarity
```javascript
// Good: Explain WHY, not WHAT
const maxRetries = 3; // API rate limit allows 3 retries per minute
// Show expected output
console.log(result); // Output: { success: true, data: [...] }
// Highlight important lines
const API_KEY = process.env.API_KEY; // ← Set this in .env file
```API Documentation Pattern
Consistent API documentation format improves developer experience:
## `functionName(param1, param2, options?)`
Brief one-line description of what this function does.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| param1 | string | Yes | Description of param1 |
| param2 | number | Yes | Description of param2 |
| options | Object | No | Optional configuration object |
| options.timeout | number | No | Request timeout in ms (default: 5000) |
| options.retries | number | No | Number of retry attempts (default: 3) |
### Returns
`Promise<Result>` - Description of what's returned
**Result Object:**
```typescript
{
success: boolean;
data: any;
error?: string;
}
```
### Throws
- `ValidationError` - When parameters are invalid
- `NetworkError` - When network request fails
### Example
```javascript
const result = await functionName('value', 42, {
timeout: 10000,
retries: 5
});
if (result.success) {
console.log(result.data);
}
```
### Related
- [`relatedFunction()`](#relatedfunction) - Similar functionality
- [Configuration Guide](#config) - Setup instructionsNaming Conventions in Markdown
Different programming languages use different casing conventions. Document them correctly:
| Context | Convention | Example | Tool |
|---|---|---|---|
| JavaScript variables | camelCase | userName | camelCase tool |
| JavaScript classes | PascalCase | UserService | PascalCase tool |
| Python variables | snake_case | user_name | snake_case tool |
| Constants | UPPER_SNAKE_CASE | MAX_RETRIES | CONSTANT_CASE tool |
| URL slugs | kebab-case | user-profile | kebab-case tool |
| File names | kebab-case | user-service.js | kebab-case tool |
Tables in Technical Documentation
Tables are essential for parameters, configuration, and comparisons. Learn more in our Markdown Table Generator Guide.
Parameter Tables
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| url | string | - | API endpoint URL |
| method | string | 'GET' | HTTP method |
| headers | Object | {} | Request headers |
| timeout | number | 5000 | Timeout in ms |Configuration Tables
| Option | Type | Required | Description | |--------|------|----------|-------------| | apiKey | string | Yes | Your API key from dashboard | | baseUrl | string | No | Override default API URL | | debug | boolean | No | Enable debug logging |
Error Code Tables
| Code | Meaning | Solution | |------|---------|----------| | 400 | Bad Request | Check request parameters | | 401 | Unauthorized | Verify API key | | 429 | Rate Limited | Reduce request frequency | | 500 | Server Error | Contact support |
Admonitions and Callouts
Use blockquotes for important information:
> **Note:** General information > **Warning:** Important caution > **Tip:** Helpful suggestion > **Important:** Critical information > **Deprecated:** Feature no longer recommended
Or use GitHub's new alert syntax (see our GitHub Markdown Guide):
> [!NOTE] > Useful information > [!WARNING] > Critical warning > [!TIP] > Helpful advice
Linking Strategies
1. Internal Documentation Links
See [Installation Guide](../guides/installation.md) See [API Reference](#api-reference) See [Configuration](./config.md#database-options)
2. External Links
[Official Documentation](https://example.com/docs) [GitHub Repository](https://github.com/user/repo) [Stack Overflow Tag](https://stackoverflow.com/questions/tagged/yourtag)
3. Anchor Links (Table of Contents)
## Table of Contents - [Installation](#installation) - [Quick Start](#quick-start) - [API Reference](#api-reference) - [Authentication](#authentication) - [Endpoints](#endpoints) ## Installation ... ## Quick Start ...
Command-Line Documentation
Format for CLI Commands
## `command-name [options] <required> [optional]` Description of what the command does. ### Options - `-h, --help` - Show help message - `-v, --verbose` - Enable verbose output - `-o, --output <file>` - Output file path ### Examples ```bash # Basic usage command-name file.txt # With options command-name --verbose -o output.txt file.txt # Multiple files command-name file1.txt file2.txt file3.txt ```
Version Control Best Practices
1. Changelog Format
# Changelog All notable changes to this project will be documented in this file. ## [2.0.0] - 2026-01-09 ### Added - New feature X - Support for Y ### Changed - Improved performance of Z - Updated dependencies ### Deprecated - Old API endpoint (use new endpoint instead) ### Removed - Legacy feature A ### Fixed - Bug in feature B - Security vulnerability CVE-2026-1234 ### Security - Updated authentication system ## [1.0.0] - 2025-12-01 Initial release
2. Version Documentation
Always document version-specific features:
## `newFeature()` > **Added in:** v2.0.0 Description of feature. ## `oldFeature()` > **Deprecated in:** v2.0.0 > **Use instead:** [`newFeature()`](#newfeature) This feature will be removed in v3.0.0.
Accessibility Considerations
1. Alt Text for Images
<!-- Bad: No alt text -->  <!-- Good: Descriptive alt text --> 
2. Descriptive Link Text
❌ Bad
Click [here](link) for docs. Read more [here](link).
✅ Good
See the [API documentation](link). Read the [installation guide](link).
Documentation Maintenance
Keep Docs in Sync with Code
- Update docs in the same PR as code changes
- Use automated tests to catch outdated examples
- Set up CI to check for broken links
- Review docs during code review
Use Documentation Linters
# markdownlint - Markdown style checker npm install -g markdownlint-cli markdownlint docs/**/*.md # markdown-link-check - Find broken links npm install -g markdown-link-check markdown-link-check docs/README.md # write-good - Prose linter npm install -g write-good write-good docs/**/*.md
Tools and Generators
- Markdown Formatter - Write and preview documentation
- Markdown Table Generator - Create parameter tables
- Slugify Tool - Generate URL-friendly slugs
- Case Converters - Format code identifiers correctly
- Markdown to HTML - Export docs as HTML
- GitHub Markdown Guide - GitHub-specific syntax
Static Site Generators for Docs
Convert markdown docs to beautiful websites:
1. Docusaurus (React-based)
npx create-docusaurus@latest my-docs classic cd my-docs npm start
Best for: Large documentation sites, React projects (Meta, Facebook, Jest use it)
2. MkDocs (Python-based)
pip install mkdocs mkdocs new my-docs cd my-docs mkdocs serve
Best for: Python projects, simple docs, Material theme
3. VuePress (Vue-based)
npm create vuepress-site my-docs cd my-docs npm install npm run dev
Best for: Vue projects, Vue ecosystem documentation
4. GitBook
Best for: Non-technical teams, beautiful UI, hosted solution
SEO for Documentation
- Descriptive Titles: Front matter with page titles
- Meta Descriptions: Add descriptions to front matter
- Clean URLs: Use slugified file names
- Internal Linking: Link related documentation pages
- Canonical URLs: Prevent duplicate content
- Sitemap: Generate sitemap.xml for docs site
Documentation Templates
API Endpoint Template
## GET /api/users/:id
Retrieves a single user by ID.
### Authentication
Requires API key in `Authorization` header.
### URL Parameters
| Name | Type | Description |
|------|------|-------------|
| id | string | User ID |
### Query Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| include | string | No | Related data to include (profile, posts) |
### Request Headers
```
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
```
### Response (200 OK)
```json
{
"success": true,
"data": {
"id": "123",
"name": "John Doe",
"email": "john@example.com"
}
}
```
### Error Responses
| Code | Description |
|------|-------------|
| 401 | Invalid or missing API key |
| 404 | User not found |
| 500 | Server error |
### Example
```javascript
const response = await fetch('https://api.example.com/api/users/123', {
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();
```Frequently Asked Questions
How long should documentation be?
As long as necessary, as short as possible. Each page should cover one topic thoroughly. Break large guides into multiple pages with a table of contents.
Should I use emoji in technical docs?
Sparingly. Use emoji for visual hierarchy (✅ ❌ ⚠️ 💡) but avoid overdoing it. Professional docs should prioritize clarity over personality.
How do I handle code that spans multiple languages?
Use tabs or accordion sections (HTML details/summary tags) to show the same example in multiple languages. Or create separate guides per language.
Should documentation live in the repo or separate site?
Both! Keep README.md and basic docs in the repo. Use a static site generator (Docusaurus, MkDocs) for comprehensive documentation hosted separately. Link between them.
Start Writing Professional Documentation
Use our Markdown Formatter to write, preview, and export technical documentation with live rendering.
Open Markdown Formatter →