Docs
Jesse Sumrak
July 31, 2025

Docs-as-code: What is it, how it works, and ways to start

Traditional documentation workflows are broken.

Your codebase lives in Git with proper version control, reviews, and automated deployments, but your docs are trapped in CMS systems.

Introducing docs-as-code

Docs-as-code writes documentation with the same tools and processes as source code: version control, pull requests, automated testing, and continuous deployment.

Everything lives in your Git repository. When you update an API endpoint, you update the documentation in the same pull request. When code gets reviewed, docs get reviewed. When code deploys, docs deploy.

This creates always up-to-date documentation because it's part of your development workflow (not an afterthought).

Documentation’s messy history (how we got here)

Documentation tools have historically lagged behind developer workflows. In the early days, we had Word documents passed around on floppy disks…yes, really. Then came wikis, which felt revolutionary until you realized anyone could edit anything and version control meant "hope someone remembers what changed."

The 2000s brought us Confluence and CMS systems: enterprise solutions that made updating docs feel like filing taxes. These tools forced technical concepts into word processor-style interfaces that made it nearly impossible to write code examples that didn't break formatting. And when multiple people edited the same page simultaneously? Good luck figuring out who changed what, or why the entire document suddenly lost all its formatting.

All the while, developers embraced Git for everything else. Except documentation lived in this parallel universe where "latest version" was whichever file had the word 'FINAL' in all caps (and maybe three more 'FINALs' after it).

Docs-as-code emerged when developers finally pulled documentation into the workflows they use every day.

The first wave of docs-as-code tools solved the basic problem: getting documentation out of wikis and into Git. Suddenly, documentation could be versioned, reviewed, and deployed with the same reliability as application code.

But we're now seeing a next-generation of tools that push docs-as-code even further. Platforms like Fern don't just store docs in Git: they generate beautiful, interactive documentation sites directly from your API specifications and tightly couple them with your development workflow. Features like visual editors that create pull requests, machine-readable formats like llms.txt for AI agents, and custom React components so that you can augment capabilities that aren’t provided out-of-the-box.

How docs-as-code works

Docs-as-code applies proven development practices to documentation. Everything lives in your Git repository alongside the code it describes. This includes:

  1. Developer-native tools: Documentation integrates into existing workflows. Write docs in your go-to IDE with syntax highlighting and autocomplete. Submit changes via pull requests with proper diff views. Deploy through the same CI/CD pipelines that handle your code.
  2. Git-based workflows: Your docs get the same version control as your code. Create feature branches for documentation updates, merge when ready, and roll back when something breaks. If you need to document a breaking API change, just branch off the same commit, update both code and docs together, then merge as one complete change.
  3. Review processes: The same standards apply to docs-as-code changes. Technical writers review for clarity, engineers verify accuracy, and product managers check messaging. Pull requests catch typos, broken links, and outdated examples before they reach users.
  4. Automated publishing: Push to main, and your changes go live automatically through documentation generators like Fern. No manual uploads to WordPress, no forgotten deployments.

Under the hood of docs-as-code tools

Modern docs-as-code tools handle the entire pipeline from writing to deployment with some focusing on more specific parts of the workflow. Here’s the tech stack going on under the hood of a docs-as-code tool like Fern:

Fern is a markdown-based platform that enables teams to build documentation using familiar 'docs-as-code' workflows. The platform handles static site generation and hosting automatically while providing both command-line and visual editing options.

The Fern CLI (Command Line Interface) integrates directly into your development workflow with commands like fern generate to create documentation and fern docs dev to run a version of your website locally. Documentation—in the form of Markdown or MDX files—can live in a monorepo or a dedicated docs repo.

For teams that prefer visual editing, Fern also includes a WYSIWYG editor that creates pull requests automatically—bridging the gap between technical and non-technical contributors without sacrificing Git-based workflows.

Automation platforms like GitHub Actions and GitLab CI can trigger fern generate whenever your API specification changes. This keeps documentation perfectly synchronized with code changes: when you ship a new endpoint, the docs update automatically without manual intervention.

4 best practices for better documentation

Getting docs-as-code right is as much about the tools as it is the habits and processes. These practices ultimately separate teams with great docs from teams with...well, documentation that exists.

  1. Treat docs like code (seriously): Apply the same review standards to documentation as code changes. Require pull request reviews, run automated tests for broken links, and block merges when docs are incomplete. If your API change doesn't include documentation updates, it's not ready to ship.
  2. Keep docs close to code: Store documentation in the same GitHub organization as the code it describes, or as close as technically possible. When docs live in a separate wiki or repository, they get forgotten.
  3. Automate everything possible: Use CI/CD to deploy docs, automated link checking to catch broken references, and scripts to generate API documentation from code comments. The less manual work required to keep docs current, the more likely they'll stay current. Tools like Fern automatically generate both documentation and SDKs from your API specification, which means one update to your spec triggers deployments across all your developer tools without any manual intervention.
  4. Make it easy for non-developers to contribute: Not everyone on your team is familiar with Git and the terminal, but everyone has valuable insights into documentation. Use tools with web interfaces, clear contribution guidelines, and workflows that don't require command-line expertise to suggest improvements. Fern's visual editor bridges this gap perfectly—product managers and technical writers can edit documentation directly in the browser, and their changes automatically create pull requests in your Git workflow (no command line required).

Docs-as-code examples (for inspiration)

ElevenLabs

ElevenLabs is a text-to-speech API that allows developers to integrate realistic AI voices into applications.

What stands out? Their landing page immediately with a bold custom soundwave animation captures user attention.

Webflow

Webflow is a visual website builder, content management system (CMS), and hosting platform all in one, that allows users to design, build, and launch responsive websites without needing to write code.

What stands out? Their product switcher and version switcher at the top allows users to toggle between different APIs and different versions. Plus, a custom footer that mirrors their global site.

Vapi

Vapi is a platform for creating voice agents that can handle phone calls with minimal human interaction.

What stands out? Use of the ‘Ask Fern’ feature allows users to instantly ask questions and get answers on documentation. Instead of having users spend minutes looking through documentation, it instantly points them to the answer.

Cohere

Cohere is a leading LLM provider with a focus on enterprise use cases.

What stands out? Easy-to-reference cards on the landing page allowing users to navigate sections and a bold design language.

The not-so-distant future: AI-powered documentation

Documentation is about to get less painful, and the changes are already starting.

  • Auto-suggestion workflows: AI is starting to analyze code changes and automatically generate pull requests with corresponding documentation updates. Push a new API endpoint, get a suggested docs update that matches your existing patterns and style. Companies like Promptless and Quantstruct are already monitoring software changes and proactively drafting documentation updates for review, while Fern automatically regenerates API reference and SDKs directly from spec changes.
  • Agent interaction: Text formats like llms.txt and .md versions of each page are making documentation machine-readable, enabling AI agents to understand your product’s capabilities quickly and accurately.
  • Democratization: WYSIWYG editors are finally aligning with Git workflows, allowing non-technical team members to contribute to documentation. You get the benefits of docs-as-code, without the learning curve.
  • Vibe coding: Natural language interfaces will let you describe what you want documented and generate the actual content. "Document the new webhook flow" becomes a working draft instead of a blank page. Webflow's MCP (Model Context Protocol) server shows this in action— developers can describe documentation needs in natural language and get structured content generated automatically.

Stop fighting your documentation (start using it)

Docs-as-code is more than a workflow: it's developer sanity. No more broken links, outdated examples, or that awkward dread when someone asks, "where are the docs?". APIs deserve better than sloppy-written README files and wiki pages that are stale.

Fern takes docs-as-code and makes it enjoyable. Generate documentation and SDKs from your API spec (OpenAPI, AsyncAPI, OpenRPC, and gRPC), deploy in CI/CD with every code change, and watch your developers stop complaining about documentation for the first time in your company's history.

Want to see what good documentation feels like? Book a demo and we'll show you how teams like ElevenLabs, Webflow, and Alchemy turn their documentation into a competitive advantage.

Jesse Sumrak
July 31, 2025

Get started today

Our team partners with you to launch SDKs and branded API docs that scale to millions of users.