Technical Documentation Complete Guide: Markdown Standards, API Documentation & Engineering Writing Best Practices

"The code is the documentation" sounds elegant until six months later you can't understand your own API. Good technical documentation isn't just supplementary — it determines whether an open source project gets adopted, whether an API gets integrated correctly, and whether a new engineer can onboard in two weeks. This guide builds a practical, maintainable documentation system from the ground up.

1. The Four Types of Technical Documentation

The Diátaxis framework divides technical documentation into four quadrants, each with different purposes and audiences:

TypePurposeExample
TutorialGuide beginners to their first success"Get Started in 5 Minutes"
How-to GuideStep-by-step instructions for specific tasks"How to Configure Environment Variables"
ReferencePrecise technical specificationsAPI endpoint docs, config parameter lists
ExplanationBackground concepts and design rationaleArchitecture Decision Records (ADR)

Most engineering teams only write Reference docs (listing API endpoints) and skip Tutorials and How-to Guides — which are often what users need most.

2. README: Your Project's First Impression

A good README should contain:

  1. One-sentence description: What this is and what problem it solves
  2. Quick Start: Get it running in 3 steps or fewer
  3. Usage examples: The most typical scenario, with code
  4. Configuration: Environment variables, config file format
  5. Contributing guide: How to report bugs, submit PRs
  6. License: MIT, Apache 2.0, etc.

Common README Mistakes

  • Assuming reader background knowledge ("first install Node.js" without specifying version)
  • Example code that's outdated but never updated
  • Listing features without explaining use cases
  • Not describing what the project is not for (preventing misuse)
Live Markdown preview: When writing READMEs, use the Markdown editor to preview formatting in real time — verify heading hierarchy, tables, and code blocks look correct before pushing to GitHub.

3. Markdown Standards for Technical Docs

Heading Hierarchy Rules

  • # (H1): One per document, typically the document title
  • ## (H2): Major sections
  • ### (H3): Subsections — avoid going deeper than H3
  • Never skip levels: don't jump from H2 directly to H4

Code Block Best Practices

Always specify the language for syntax highlighting:

```bash
npm install your-package
```

```json
{
  "key": "value"
}
```

Links and Images

  • Avoid bare URLs — use meaningful anchor text: [Configuration Guide](#configuration)
  • Images need alt text: ![Architecture Diagram](./docs/architecture.png)
  • Internal links use relative paths; external links use full HTTPS URLs

4. API Documentation: The Core of Developer Experience

API documentation is the manual for engineers integrating your service. Its quality directly affects integration success rates and support burden.

Required API Documentation Elements

  1. Endpoint description: HTTP method + path + purpose
  2. Parameters: Path params, query params, request body — each with name, type, required/optional, default, example
  3. Request example: Complete HTTP request with real (not foo/bar) example values
  4. Response schema: Both success and error response structures, all HTTP status codes
  5. Error codes: All custom error codes with descriptions and troubleshooting steps
Format API response examples: Use the JSON Formatter to convert minified JSON into readable indented format for documentation examples — readers can instantly understand the response structure.

OpenAPI / Swagger Specification

For RESTful APIs, adopt the OpenAPI 3.0 specification (YAML or JSON). Benefits include:

  • Auto-generates interactive Swagger UI — users test APIs directly in the browser
  • Importable into Postman/Insomnia for automatic test request creation
  • Auto-generated from code in frameworks like FastAPI, SpringDoc
  • Structured format is easy to version-control and diff

5. Docs as Code: Managing Documentation Like Software

"Docs as Code" applies the same version control, review, and CI/CD practices to documentation as to code:

  • Docs in the same PR as code changes: API behavior changes must include doc updates in the same PR — no doc update, no merge
  • Doc review: Have non-engineers review for clarity and comprehension
  • Broken link checks: CI/CD automatically scans for dead links in documentation
  • Test documentation examples: Code snippets in tutorials run as part of CI to catch regressions
Compare documentation versions: After updates, use the Text Diff tool to quickly identify changes between old and new versions — perfect for PR descriptions or verifying translation consistency.

6. Keeping Documentation Current: Engineering Mechanisms

  1. Doc owner: Assign a maintainer to each critical document, with quarterly reviews
  2. Automated example testing: Tutorial code snippets run in CI so breakage is caught immediately
  3. User feedback channel: Add "Was this helpful?" and issue reporting links at the bottom of doc pages
  4. Changelog discipline: Maintain a CHANGELOG.md for every release — added, changed, deprecated, removed
  5. "Pending documentation" markers: Mark unfinished sections with TODO or warning callouts — more honest than silence

Summary

  • Technical docs have four types: Tutorial, How-to Guide, Reference, Explanation — most projects only have Reference
  • READMEs must get users to a working state in ≤3 steps, with real (not placeholder) examples
  • Markdown best practices: don't skip heading levels, specify code block language, use meaningful link anchor text
  • API docs must include: endpoint description, all parameters, request example, response schema, error codes
  • Docs as Code — same PR, same review, same CI as code — is the foundational mechanism for keeping docs alive