Insights / Article

Docs as code: API and SDK documentation that keeps up with the product

Documentation falls behind when it lives apart from the product. This is how I run API and SDK documentation as code, with Git, structured authoring and OpenAPI, so it ships with every release.

Most documentation is out of date the day it is published, because it is written after the product and stored somewhere else. Docs as code fixes that by treating documentation like software: written in plain text, versioned in Git, reviewed and released with the product.

I’ve written API and SDK documentation, built structured documentation in DITA XML and migrated content between systems, for data platforms, enterprise software and fintech. These are the practices I rely on.

What docs as code means

Writers work in Markdown or XML in the same workflow as the developers. Every change goes through a pull request, gets reviewed and is published automatically, so the documentation always matches a specific version of the product.

The building blocks

Plain text and Git

Markdown or XML files in Git give you history, branches and reviews.

Structured authoring

With DITA XML, content is written once as topics and reused across guides, so a change is made in one place.

API reference from the source

An OpenAPI description generates the reference, and Postman collections let readers try the calls, so the reference can’t drift from the API.

Review like code

Developers review the documentation in the same pull request as the feature.

Automated publishing

A pipeline builds and publishes the documentation with every release.

Documentation that ships with the release is documentation people trust.

Where it pays off

API and SDK documentation

Developers judge a product by its documentation. Accurate examples and a reference that matches the API shorten integration time.

Large documentation programmes

At Valeo I documented all PLM processes for the Enovia rollout across the corporation. At that scale, structure and version control are the only way to stay consistent.

Tracking in Jira and Confluence

Linking documentation tasks to development tickets shows what still needs writing before a release.

What to measure

  • Time from feature complete to documentation published
  • Share of releases shipped with updated documentation
  • Support tickets answered by the documentation
  • Topics reused in more than one guide

Start with one product

Move one product’s documentation into Git, connect it to the release pipeline and expand from there. If you’d like help setting up docs as code, get in touch.