Documentation as Code
Documentation that lives in GitHub, evolves with your code, and never falls out of sync. We build production-grade Nextra documentation sites — MDX-first, full-text search, custom component libraries, and GitHub Actions pipelines that deploy on every merge. CNBS runs its own documentation on this exact stack, so everything we deliver comes from production experience.
How Documentation as Code Works
Documentation as Code treats every page, diagram, and reference as a version-controlled artefact — authored in MDX (Markdown + JSX), reviewed via pull request, and deployed automatically on merge. Nextra provides the framework: it maps a directory of MDX files to a navigable, searchable documentation site with zero configuration for the common case. CNBS builds on top of this foundation with custom components, automated content pipelines, and a CI/CD model that makes contributing to docs feel identical to contributing to code.
Docs drift because they live outside the development workflow. Putting them in the same repository as the code, reviewed by the same people in the same PRs, is the only durable fix. Nextra’s zero-config approach makes this low-friction: authors write MDX, navigation is declared in a _meta.js file, and the site builds itself.
Nextra-Only: Why We Don’t Offer Docusaurus
We exclusively deliver Nextra for documentation-as-code engagements. Nextra is built on Next.js and React — the same stack used across modern frontend development. Your team can contribute to the documentation site using the same toolchain they use for their applications. We run this exact site on Nextra, which means every component, pipeline pattern, and hosting configuration we deliver is proven in production.
The Nextra docs theme provides a structured, sidebar-driven layout suited to technical documentation, API references, runbooks, and architecture guides. Navigation is controlled entirely by _meta.js files — no frontmatter configuration required per page. Full-text search is delivered by Pagefind, indexed at build time, with no external search service dependency.
- Sidebar navigation driven by _meta.js hierarchy
- Table of contents auto-generated from headings
- Pagefind full-text search — no Algolia dependency
- Dark / light mode, responsive layout
- Code blocks with syntax highlighting and copy button
Standard Nextra is extended with a custom MDX component library that matches your brand and documentation patterns. Callouts, badges, architecture diagrams, flow visualisations, API endpoint cards, and step-by-step guides are delivered as reusable JSX components — authors use them in MDX without touching React or CSS. Components are type-safe and documented.
- Callout / alert components (info, warning, tip, danger)
- Architecture diagram primitives (layers, flows, chips)
- Step-by-step numbered procedure components
- API endpoint reference cards
- Badge and tag components for status / version labelling
Core Capabilities
What We Deliver
Nextra Site Setup & Theme Configuration
Nextra project initialised with Next.js App Router, nextra-theme-docs, Tailwind CSS, and static export configured. Theme customised to your brand — colours, logo, fonts, and footer. Navigation structure designed and implemented via _meta.js hierarchy. Pagefind full-text search integrated and validated. Dark/light mode, responsive layout, and SEO metadata configured.
Content Architecture & Navigation Design
Information architecture designed for your documentation scope — directory structure, page hierarchy, and navigation groupings that match how your users look for information. _meta.js files configured for all sections. URL structure agreed and stabilised before content migration to avoid link rot. Page templates created for common content types: guides, reference pages, runbooks, and ADRs.
Custom MDX Component Library
A set of reusable JSX components registered in mdx-components.js — usable in MDX without any import statement. Callouts (info, warning, tip, danger), badges, architecture diagram primitives (layered diagrams, flow sequences), step-by-step numbered procedures, API endpoint cards, and code blocks with language labels. All components are type-safe, styled to your design system, and documented with usage examples.
GitHub Actions CI/CD Pipeline
Production deploy pipeline: on merge to main — install, build, pagefind index, sync to S3, invalidate CloudFront cache. PR preview pipeline: on PR open/update — build and deploy to a branch-specific S3 prefix, post the preview URL as a PR comment. Link checker and build validation run on every PR. Pipeline includes approval gate for production deploys if required.
Auto-Generated Content Integration
Build-time scripts that pull OpenAPI or AsyncAPI specifications from your source repositories and render them as structured MDX API reference pages — automatically updated on every deploy. README and ADR pull scripts for embedding repository-level documentation into the site. Mermaid diagram rendering configured for architecture diagrams authored in source files.
Static Hosting on Your Infrastructure
Terraform-provisioned S3 bucket and CloudFront distribution with ACM TLS certificate, custom domain, and security headers (HSTS, CSP, X-Frame-Options). Route 53 DNS configuration. CloudFront cache invalidation integrated into the deploy pipeline. Hosting configuration is yours — no subscription to a documentation platform, no usage-based pricing, no data leaving your AWS account.
How Customers Benefit
How We Work
Content Audit & Architecture Design
We review your existing documentation — wikis, Confluence spaces, README files, architecture records, runbooks — and design an information architecture that maps to Nextra’s directory-based navigation model. URL structure, section hierarchy, and content types agreed before any code is written.
Nextra Setup & Component Library
Nextra project initialised with your branding, theme configuration, and static export settings. Custom MDX component library built and registered. Pagefind search integrated and validated. Page templates created for each content type — authors have a clear starting point for every page they write.
GitHub Actions Pipeline & Hosting
Production and PR preview pipelines configured. Terraform provisions S3 bucket, CloudFront distribution, ACM certificate, and Route 53 DNS. First production deploy validated end-to-end — build, index, sync, cache invalidation, custom domain resolution. Branch protection rules and PR preview deployment configured.
Auto-Generated Content & Content Migration
OpenAPI/AsyncAPI generation scripts built and integrated into the build pipeline. README and ADR pull scripts configured for repositories in scope. Existing documentation migrated from source systems into MDX — reformatted, restructured, and cross-linked according to the agreed information architecture.
Handover & Team Enablement
Contribution guide written — how to add a page, how to use each component, how the pipeline works, how to run the site locally. Live walkthrough with your team covering the authoring workflow, PR review process, and how to extend the component library. CNBS available for ongoing feature additions and platform maintenance under a retained arrangement.
Ready to fix documentation for good?
Let’s build your documentation system — in your repo, on your infrastructure, maintained like code.
Tell us about your current documentation landscape, your team’s toolchain, and what content needs to live there — we’ll design and deliver a Nextra site that your team actually wants to contribute to.
Get in touch →