Docs-as-Code Reference Guide
This is a comprehensive methodology reference for Docs-as-Code โ the practice of applying software engineering discipline to documentation. It covers concepts, workflows, tooling, and architecture decisions. For the interactive prototype that demonstrates these principles in action, see DocForge โ
This Reference Guide is one part of a connected documentation engineering case study. DocForge Platform is the product landing page explaining why it was built. DocForge Demo is the interactive prototype with six live modules. And "No Tool Covers the Full Docs Pipeline" is the build narrative that started it all.
What Is This Platform?
The Docs-as-Code Platform is a purpose-built system for teams who want their documentation to behave like their code. Instead of managing docs in shared Word files, disconnected wikis, or manual CMS tools, this platform treats every document as source code โ stored in Git, reviewed via pull requests, tested through a CI/CD pipeline, and deployed automatically to multiple output formats.
It was designed and built by Sulagna Sasmal, a Technical Writer and Documentation Engineer specializing in fintech, compliance platforms, and developer-facing APIs. The platform reflects how documentation should work in regulated, engineering-led organizations.
Docs-as-Code means applying the same tools, workflows, and standards used for software development โ Git, code review, CI/CD, automated testing โ to the creation and maintenance of documentation.
Purpose & Goals
Documentation fails organizations for predictable reasons: it goes out of date immediately after release, no one knows what changed or when, quality is inconsistent across authors, and publishing is a slow manual process. This platform was built to solve each of those problems systematically.
- Single source of truth: one Markdown source compiles to every output format. No copy-paste drift between the web portal, PDF, and API spec.
- Full audit history: every change is tracked in Git with author, timestamp, and commit message. Critical for regulated industries like financial services and healthcare.
- Automated quality gates: style linting, broken-link detection, and structural validation run on every commit before anything reaches readers.
- Continuous publishing: docs go live the moment a pull request merges. No manual export steps, no publishing queues, no staging servers to manage.
- Developer-native workflow: writers work in the same tools engineers use. Docs ship alongside the feature, not weeks after.
Who Is This For?
| Role | How this platform helps |
|---|---|
| Technical Writers | Write in Markdown with full tooling support, use Git branches for drafts, get automated style feedback before review |
| Documentation Engineers | Manage the build pipeline, define style rules, configure output targets, monitor doc health via the dashboard |
| Development Teams | Review and approve doc changes via pull requests, same as code โ docs ship with the feature |
| Compliance Teams | Query the tamper-evident Git history for any documentation change, exportable as a signed audit report |
| Product Managers | Track documentation coverage against feature releases, view build health and content metrics in the dashboard |
Platform at a Glance
The platform consists of five pipeline stages and six management modules. The pipeline is the automated process that converts source files into published documentation. The modules are the interactive tools for managing that process.
Explore the Platform
What Is Docs-as-Code?
Docs-as-Code is a documentation methodology that applies software engineering discipline โ version control, peer review, automated testing, continuous delivery โ to how documentation is written, managed, and published. It is not a tool. It is a way of working.
The Core Idea
Software teams have spent decades building practices that make code reliable, traceable, and maintainable: every change is tracked in Git, reviewed by peers, tested automatically before it ships, and deployed with a repeatable process. Documentation teams have largely not had access to those same practices โ until Docs-as-Code.
The insight is straightforward: documentation is a deliverable that belongs to the same codebase as the software it describes. When docs live in a Git repository, written in plain text formats like Markdown, they gain all the same properties as the code they document: full history, structured review, automated quality checks, and continuous deployment.
The Five Principles
- 1Plain text source
Documentation is written in a lightweight markup language โ Markdown, MDX, or reStructuredText โ not in proprietary formats. Plain text is readable by humans, diffable by tools, and not locked to any vendor.
- 2Version controlled in Git
Every change to every document is committed to a Git repository. The full history of who changed what, when, and why is permanently available. Branches enable parallel drafts without overwriting each other.
- 3Reviewed like code
Documentation changes go through pull requests. Subject-matter experts, editors, and engineers review the diff before anything merges. Review comments are visible, tracked, and resolved โ creating a transparent editorial process.
- 4Tested before publishing
A CI pipeline runs automatically on every change. It checks for broken links, style guide violations, missing frontmatter, schema errors in OpenAPI specs, and any other quality rule the team defines. The build fails if standards are not met.
- 5Deployed continuously
When a change merges, the documentation site rebuilds and deploys automatically. The published site is always in sync with the repository. There is no manual publish step, no FTP uploads, no stale cached versions.
Traditional Docs vs Docs-as-Code
| Area | Traditional Documentation | Docs-as-Code |
|---|---|---|
| Source format | Word, PDF, wiki markup | Markdown / MDX / OpenAPI |
| Version control | File naming (v2_FINAL.docx) | Git: full history, branches, tags |
| Review process | Email chains, tracked changes | Pull requests with inline comments |
| Quality checks | Manual proofreading | Automated lint, link checks, CI |
| Publishing | Manual export and upload | Automatic on merge |
| Audit trail | None or fragmented | Complete: every commit is signed |
| Multi-format output | Maintain separate files per format | One source โ HTML, PDF, JSON, search index |
| Collaboration | One person edits at a time | Parallel branches, no conflicts until merge |
The Toolchain
Docs-as-Code relies on a composable toolchain. You choose the tools that fit your stack โ the methodology works with any combination.
| Stage | Tools |
|---|---|
| Writing | VS Code, any text editor, or this platform's Live Editor |
| Version control | Git, GitHub, GitLab, Bitbucket |
| Build | MkDocs, Sphinx, Hugo, Docusaurus, Eleventy |
| Linting | Vale (style), markdownlint (structure), lychee (links) |
| CI/CD | GitHub Actions, GitLab CI, CircleCI, Jenkins |
| Hosting | GitHub Pages, Netlify, Vercel, AWS S3 + CloudFront |
In financial services, healthcare, and other regulated domains, documentation is not just a developer convenience โ it is evidence. A Git repository provides a tamper-evident, timestamped record of every change to every document. That record can be exported as a compliance audit report at any time.
Quick Start Guide
This guide walks you through setting up a Docs-as-Code pipeline from scratch โ from creating your repository to seeing your documentation go live on GitHub Pages. Estimated time: 15 minutes.
Prerequisites
| Tool | Version | Purpose |
|---|---|---|
git | 2.x+ | Version control for your docs source |
python | 3.10+ | Required by MkDocs build engine |
pip | latest | Installs MkDocs and plugins |
| GitHub account | โ | Repository hosting and GitHub Pages deployment |
| Vale CLI | 3.x+ | Style linting (optional for quick start) |
Setup Steps
- 1Create and clone your repository
Create a new public repository on GitHub, then clone it locally. This is where all your documentation source files will live.
git clone https://github.com/your-username/your-docs-repo.git
cd your-docs-repo
- 2Install MkDocs and the Material theme
MkDocs is the build engine. The Material theme provides a professional documentation portal layout out of the box.
pip install mkdocs mkdocs-material
- 3Initialize the project structure
Run
mkdocs new .to scaffold the config file anddocs/directory. Your first document is created automatically.
mkdocs new .
# Output structure:
your-docs-repo/
โโโ mkdocs.yml # site configuration
โโโ docs/
โโโ index.md # your first page
- 4Configure your site
Edit
mkdocs.ymlto set your site name, theme, and navigation. This is the single configuration file that controls the entire build.
site_name: My Documentation
site_url: https://your-username.github.io/your-docs-repo/
theme:
name: material
palette:
scheme: slate
primary: amber
nav:
- Home: index.md
- Getting Started: getting-started.md
- 5Preview locally, commit, and deploy
Run the local server to preview your site, then commit and push. GitHub Actions will build and deploy to GitHub Pages automatically.
# Preview locally on http://127.0.0.1:8000
mkdocs serve
# Commit and push
git add .
git commit -m "docs: initialize documentation site"
git push origin main
# Deploy to GitHub Pages manually (or via Actions)
mkdocs gh-deploy
See the CI/CD Integration guide to set up a GitHub Actions workflow that builds and deploys automatically on every push to main.
The Docs Pipeline
The documentation pipeline is the automated workflow that takes a Markdown source file from a writer's editor to a published, validated, multi-format documentation site. It has five stages. Each stage is a quality gate โ if a stage fails, the change does not proceed.
Stage 1: Write
Authors write documentation in Markdown (or MDX for React-based portals, or YAML/JSON for OpenAPI specs). The source format is chosen for portability: it can be read by any text editor, diffed by any version control tool, and compiled by any documentation build engine.
Good documentation source files follow a consistent structure: a frontmatter block (title, description, last reviewed date), then the content using headings, paragraphs, code blocks, and tables. The platform's Live Editor provides a split-pane environment to write and preview simultaneously.
---
title: Authentication
description: How to authenticate API requests using Bearer tokens
last_reviewed: 2026-02-01
---
# Authentication
All API requests must include a valid Bearer token in the `Authorization` header...
Stage 2: Commit & Review
Once the author is satisfied with a draft, they commit the change to a feature branch in Git and open a pull request. The pull request is the review interface: it shows exactly what changed (a readable diff of Markdown), allows inline comments on specific lines, and tracks when comments are resolved.
This stage enforces that no documentation reaches readers without being seen by at least one other person โ whether a subject-matter expert, a peer writer, or an engineer who built the feature. The review history becomes a permanent record of editorial decisions.
Stage 3: Build
When the pull request is opened, the CI pipeline triggers a build. The build engine (MkDocs, Sphinx, or Hugo depending on configuration) compiles all Markdown source files into the configured output formats. A successful build confirms that the site structure is valid and all referenced files exist.
Stage 4: Validate
Validation runs in parallel with the build. The style linter (Vale) checks every changed file against the configured rule set. The link checker scans all internal and external links. Schema validators check OpenAPI specs. If any check fails, the CI run is marked failed and the pull request cannot merge until the issue is resolved.
Branch protection rules should require all CI checks to pass before a pull request can merge. This is what makes the pipeline a quality gate, not just a suggestion.
Stage 5: Publish
When the pull request merges, the build and deploy workflow runs against the main branch. The compiled HTML site, PDF export, OpenAPI JSON, and search index are uploaded to the configured hosting target. The live site updates within minutes of the merge, with no manual intervention required.
Version Control for Documentation
Storing documentation in Git gives every team member a complete, auditable history of every change ever made. This page explains the branching strategy, commit conventions, and pull request process used in this platform.
Branching Strategy
| Branch | Purpose | Merge target |
|---|---|---|
main | Always-publishable source of truth. Protected: no direct commits. | โ |
docs/feature-name | New content or significant updates to existing content | main |
docs/fix-* | Typo fixes, broken link repairs, minor corrections | main |
release/vX.Y | Versioned documentation snapshot for a product release | main |
Commit Conventions
Consistent commit messages make the Git log readable and enable automated changelog generation. This platform follows a documentation-specific adaptation of Conventional Commits:
docs(scope): short description of the change
# Examples:
docs(api): add rate limiting section to authentication page
docs(getting-started): fix broken link to quickstart guide
docs(compliance): update GDPR data residency table for EU region
fix(linting): resolve Vale rule violation in webhook reference
chore(config): update mkdocs.yml nav structure for v1.1
Pull Request Process
- Author opens a PR from their feature branch against
main - CI runs automatically: style lint, link check, build
- At least one reviewer approves the content changes
- All CI checks pass and review comments are resolved
- Author or reviewer merges. Deployment runs automatically
CI/CD Integration
GitHub Actions powers the build, validate, and deploy stages of the pipeline. Every push to a pull request branch triggers validation. Every merge to main triggers a full build and deployment.
GitHub Actions Workflow
The following workflow file covers the full pipeline โ linting, building, and deploying to GitHub Pages.
name: Docs CI/CD
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
lint-and-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: pip install mkdocs mkdocs-material
- name: Vale style lint
uses: errata-ai/vale-action@v2
with:
files: docs/
- name: Build documentation
run: mkdocs build --strict
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main'
run: mkdocs gh-deploy --force
Build Triggers
| Event | Jobs run | Deploys? |
|---|---|---|
| Push to PR branch | Lint, build (strict mode) | No |
Merge to main | Lint, build, deploy | Yes โ GitHub Pages |
| Manual trigger | Full pipeline | Yes |
Style Linting with Vale
Vale is a syntax-aware prose linter that enforces your documentation style guide automatically. It runs in CI on every pull request, catching inconsistencies before they reach readers โ passive voice, banned terms, incorrect product names, and readability issues.
Configuration
StylesPath = .vale/styles
MinAlertLevel = suggestion
[*.md]
BasedOnStyles = Vale, Google, DaC
DaC.PassiveVoice = warning
DaC.Terminology = error
Google.Headings = suggestion
Rule Categories
| Level | Behavior | Example rules |
|---|---|---|
| error | Fails the CI build: must fix before merge | Wrong product name, banned term, broken heading hierarchy |
| warning | Reported in CI: should fix, does not block | Passive voice, "simply" / "just", future tense for features |
| suggestion | Advisory: fix when practical | Sentence length, heading capitalization, Oxford comma |
Common Violations & Fixes
# โ Before
The request is authenticated by the server using a Bearer token.
# โ After
The server authenticates the request using a Bearer token.
# โ Before โ "whitelist" is a banned term
Add your domain to the whitelist.
# โ After
Add your domain to the allowlist.
Multi-Format Output
A single Markdown source compiles into multiple output formats simultaneously. You write once, and the build pipeline produces an HTML documentation site, a PDF manual, an OpenAPI JSON specification, and a search index โ all from the same source files.
Output Formats
| Format | Use case | Tool |
|---|---|---|
| HTML site | Primary web documentation portal, hosted on GitHub Pages or Netlify | MkDocs / Material theme |
| PDF manual | Offline distribution, print, enterprise delivery | WeasyPrint or mkdocs-with-pdf |
| OpenAPI JSON | Machine-readable API spec for Postman, Swagger UI, SDK generation | Inline YAML โ JSON conversion |
| Search index | Client-side full-text search, feeds the built-in portal search | MkDocs search plugin |
Configuring Output Targets
plugins:
- search
- with-pdf:
author: Sulagna Sasmal
cover_title: Platform Documentation
output_path: pdf/platform-docs.pdf
- tags
Never maintain separate files for different output formats. If your PDF manual and HTML site have diverged, you have two sources of truth โ which means you have none. The platform enforces single-source by generating all formats from the same pipeline run.
Dashboard
The Dashboard is the command center for your documentation project. It gives an at-a-glance view of build health, content coverage, contributor activity, and recent pipeline runs.
Key Metrics
| Metric | What it tells you |
|---|---|
| Build Status | Pass / fail of the last CI run, with link to logs |
| Content Coverage | Percentage of API endpoints, features, or topics with documentation |
| Lint Score | Number of open style warnings and errors across all files |
| Active Contributors | Authors with commits in the last 30 days |
| Last Published | Timestamp of the most recent successful deploy |
Live Editor
The Live Editor is a split-pane Markdown authoring environment with real-time HTML preview and inline Vale linting. Authors can write, preview, and fix style issues without leaving the browser.
Features
- Split-pane view: Markdown source on the left, rendered HTML preview on the right, updated on every keystroke
- Frontmatter validation: highlights missing or malformed frontmatter fields before saving
- Inline lint markers: Vale violations are underlined in the editor with hover explanations
- Keyboard shortcuts: standard editor shortcuts for bold, italic, code, links, and headings
- Export: download the current file as
.mdor copy the rendered HTML
The Live Editor is best used for initial drafting and quick edits. For complex multi-file changes, work in your local editor with the Vale VS Code extension, then commit through your normal Git workflow.
Content Map
The Content Map is a visual representation of your entire documentation structure โ every page, its position in the hierarchy, its status, and its relationships to other pages.
What It Shows
- Doc tree: full navigation hierarchy rendered as an interactive graph
- Orphaned pages: pages that exist in the
docs/folder but are not referenced in the nav - Broken cross-references: internal links that point to pages that do not exist
- Coverage gaps: sections of the nav that have placeholder stubs rather than full content
- Page metadata: last edited date, word count, lint status per page
Style Linter Module
The Style Linter module provides an interactive view of all active Vale rules, current violations across the codebase, and the ability to run a lint pass against any file on demand.
Panel Layout
- Rule browser: lists all active rules with their severity, description, and example violations
- Violations panel: all current lint issues grouped by file, filterable by severity
- Run on file: paste or select a file path and run Vale against it immediately
- Suppression manager: view and manage inline
vale off / vale onsuppressions across the codebase
For the full Vale configuration reference, see the Style Linting core concepts page.
Build Outputs
The Build Outputs module shows every artifact produced by the last successful pipeline run โ with a preview, file size, and direct download or deploy link for each format.
Available Outputs
| Output | Description | Typical size |
|---|---|---|
| HTML Site | Full static site ready for hosting. Includes search index and all assets. | 2โ15 MB |
| PDF Manual | Print-ready PDF with auto ToC, page numbers, and chapter breaks. | 1โ8 MB |
| OpenAPI JSON | Machine-readable API spec for Postman, Swagger UI, and SDK generation. | 50โ500 KB |
| Search Index | JSON index file for client-side full-text search. | 100โ800 KB |
Configuration Module
The Configuration module provides a visual editor for the platform's docs-center.config.yml file โ the single source of truth for site settings, navigation, theme, lint rules, and deploy targets.
Configuration Sections
- Site metadata: name, URL, description, author, copyright
- Navigation: page hierarchy, external links, nav sections
- Theme: color palette, logo, font, feature flags
- Lint rules: active Vale style sets, severity overrides, suppression list
- Build plugins: PDF export, search, tags, social cards
- Deploy targets: GitHub Pages, Netlify site ID, S3 bucket
For the full configuration schema reference, see the Config Schema reference page.
Configuration Schema
Complete reference for all fields in docs-center.config.yml. All fields are optional unless marked required.
Top-Level Fields
| Field | Type | Description |
|---|---|---|
site_name required | string | Display name of the documentation site |
site_url | string | Canonical URL: used in sitemap and social meta tags |
site_description | string | Short description for SEO and portal header |
site_author | string | Author name for PDF cover and page meta |
docs_dir | string | Directory containing Markdown source files. Default: docs/ |
site_dir | string | Directory for compiled output. Default: site/ |
Theme
theme:
name: material
palette:
scheme: slate # dark mode
primary: amber
accent: amber
font:
text: Inter
code: JetBrains Mono
features:
- navigation.tabs
- navigation.top
- content.code.copy
- search.highlight
Changelog
All notable changes to the Docs-as-Code Platform are documented here. This project follows Keep a Changelog and Semantic Versioning.
v1.0.0: 2026-02-28 Stable
Added
- Initial release of the Docs-as-Code Platform documentation portal
- Getting Started section: Introduction, What is Docs-as-Code, Quick Start Guide
- Core Concepts: Pipeline, Version Control, CI/CD Integration, Style Linting, Multi-Format Output
- Platform Module guides: Dashboard, Live Editor, Content Map, Style Linter, Build Outputs, Configuration
- Reference: Configuration Schema, Changelog
- GitHub Actions workflow example for full CI/CD pipeline
- Vale configuration examples with rule severity table
- Before/after examples for common lint violations
- Branching strategy and commit convention reference
Platform
- Dark amber theme consistent with VaultPay and CaseForge portfolio sites
- Fully interactive single-page navigation with dynamic table of contents
- Responsive layout: sidebar and TOC hide on smaller screens
- Hosted on GitHub Pages via
SulagnaSasmal/docs-as-code-portal