Guide

Testing Markdoc documentation examples

Markdoc resolves variables, partials and conditionals before readers see a fence. Validate in CI, then test a copy written from Markdoc's own transform.

Published
Updated
November 17, 2026
Reading time
13 min
Facts checked against
Markdoc docs on syntax, tags, nodes, variables, partials, validation and rendering, with every code block run on @markdoc/markdoc 0.5.13, Node and Python 3 (November 15, 2026)
Outlined documentation pages with a lime pulse line running out of the stack
On this pageThe short answerWhat Markdoc changes before publicationWhy Markdoc examples break or go untestedBuild the illustrative projectInspect a raw scanValidate and write a scan-ready copyTest structural and code failures separatelyTriage findingsWhere DocsAlive fitsThe sources we checkedFAQ

The short answer

Validate Markdoc with the configuration your site uses, transform the pages, and test the examples readers receive. Validation catches structural problems such as broken tags; executing the transformed examples checks a different promise: that the published code still works.

On raw Markdoc, engine 0.6.3 of DocsAlive does not substitute variables or expand partials. It scans partial files as pages of their own, runs blocks from every if/else branch, and does not group custom tabs. It does not treat .mdoc files as pages. Generate a scan-ready copy from Markdoc’s transform, then scan that copy with its limits documented below.

What Markdoc changes before publication

Markdoc syntax is a superset of CommonMark Markdown. Its curly-brace-percent tags have names, attributes and bodies, and can be self-closing. Built-in tags include if, else, table and partial. A project can also define tags and nodes for its own presentation.

Variables have a dollar-sign prefix, must be JSON-serializable and resolve during transformation. A variable tag such as the version variable can therefore change a command inside a fence before a reader copies it. A partial tag references another file through its file attribute; the partial is registered as a parsed abstract syntax tree and can receive variables. An if tag selects content based on a condition.

The fence node has content, language and process attributes. By default, Markdoc parses tags inside a fence. The process=false annotation makes the fence content plain text instead, useful when the documentation needs to show a tag itself. Annotations place attributes after a node in a separate tag. Comments require the tokenizer’s allowComments option.

Rendering has three phases. Parse turns a source string into an abstract syntax tree. Transform combines that tree with configuration and resolves variables into a renderable tree. Render produces an output such as HTML or React. validate checks the parsed tree against configuration and returns errors; custom validation functions and attribute types can add project-specific checks. See rendering and validation.

This separation is central to testing. Valid source may produce a working page, but validation does not execute code. A raw source scan may find fences that readers never see, miss setup supplied by a partial, or run a literal variable tag where the published page contains a concrete version.

Why Markdoc examples break or go untested

Markdoc is built for documentation that changes with the product: one variable can carry the current version into every install command, a partial keeps shared setup in one file, and a flag can show a different example to different readers. Each of those features moves the code a reader copies further away from the text in the source file.

The source is not what readers copy. When a fence contains a variable tag, the published page shows the resolved value and the source shows the tag. A test that reads the source tests a string no reader ever sees, and a test that skips such fences leaves the most frequently copied commands untested.

Setup lives elsewhere. A partial that loads a package or defines a helper is part of every page that includes it. Read on its own, the including page uses names that appear to come from nowhere, and the partial looks like a page with one line of code.

Conditionals hide blocks. With an if tag, a page carries code for readers who will never see it under the current flags, and code that only some readers see. Both kinds can break; only the published combination is what a given reader copies.

Custom tabs are project code. Tabs in Markdoc are tags the project defines, so their meaning lives in configuration and components, not in the Markdown. A tool that does not load that configuration cannot know which blocks are alternatives.

Validation is not execution. Markdoc's validate step reports broken structure and attribute errors, which is valuable in CI, but it never runs the JavaScript or the shell commands. A renamed export passes validation, as the probe below shows.

Build the illustrative project

The files below are illustrative. The package name acme-units is illustrative and is not a published package. The probe used Markdoc 0.5.13, Node 24, Python 3.13 and engine 0.6.3.

Install Markdoc as a development dependency in the illustrative project.

npm install --save-dev @markdoc/markdoc

The package configuration exports the library by name from inside the package and defines a documentation-check task.

{
  "name": "acme-units",
  "version": "2.1.0",
  "type": "commonjs",
  "exports": "./lib/units.js",
  "scripts": {
    "check:docs": "node tools/check-docs.mjs"
  },
  "devDependencies": {
    "@markdoc/markdoc": "^0.5.13"
  }
}

The library converts bytes to whole kibibytes and formats that value. Its two exports are used by the documentation examples.

function toKiB(bytes) {
  return Math.floor(bytes / 1024);
}

function formatSize(bytes) {
  return `${toKiB(bytes)} KiB`;
}

module.exports = { toKiB, formatSize };

The illustrative partial loads those exports. When Markdoc expands it in a page, the setup appears before later examples.

Load the package first:

```js
const { toKiB, formatSize } = require("acme-units");
```

The install page uses custom tabs and a version variable in shell and JSON fences. These tags depend on the project’s configuration; a raw Markdown reader does not resolve them.

---
title: Install
---

# Install

{% tabs %}
{% tab label="npm" %}
```bash
npm install acme-units@{% $version %}
```
{% /tab %}
{% tab label="yarn" %}
```bash
yarn add acme-units@{% $version %}
```
{% /tab %}
{% /tabs %}

Pin the version in package.json:

```json
{ "dependencies": { "acme-units": "{% $version %}" } }
```

The usage page includes the partial, uses its setup in later JavaScript blocks, selects a branch with a flag and shows a literal tag in a fence with the process=false annotation.

---
title: Usage
---

# Usage

{% partial file="setup.md" /%}

```js
console.log(toKiB(2048));
```

{% if $flags.esm %}
```js
import { formatSize } from "acme-units";
console.log(formatSize(1536));
```
{% else /%}
```js
console.log(formatSize(1536));
```
{% /if %}

Show the tag itself instead of the version:

```markdown {% process=false %}
npm install acme-units@{% $version %}
```

The raw source contains more possible code paths than the page rendered with one flag setting. It also contains setup in a different file. Those are useful authoring features, but they make the source fences an incomplete representation of any one reader’s path.

Inspect a raw scan

This command plans a scan of the illustrative project. It does not execute the blocks by itself.

docsalive scan .

The plan found three pages and eight blocks: the install page, usage page and partial as a separate page. In the engine-driver probe with the network off, the install command was skipped for lack of network and the alternate package-manager command was skipped as a missing host tool. The JSON block parsed with the variable tag still present as a string. The partial passed on its own page.

On the usage page, two blocks relying on the partial failed as depends-on-context. The branch hidden by the false flag nevertheless ran and passed. The Markdown fence was skipped as non-executable. If a command containing a variable tag is run from raw source, the engine receives that literal text because it does not substitute the value; the probe’s install command was skipped, so it did not demonstrate such an execution.

A passing JSON parse establishes only that the source is parseable JSON under the engine’s check. It does not establish that Markdoc substituted the intended version or that the dependency value is correct for a release.

Markdoc feature What Markdoc does What the engine does in 0.6.3
Variable Resolves it during transform Leaves the raw tag text in the fence
Partial Expands a registered parsed partial Does not expand it; scans a partial file as its own page
If and else Includes the active branch after transform Plans blocks in every branch
Custom tabs Renders the configured tags Does not group these custom tab blocks as alternatives
process=false Keeps fence content as plain text Uses the first fence label; a Markdown fence is skipped as non-executable
Validation Checks the tree against configuration A scan is a separate execution and triage step
.mdoc file Can be used by a Markdoc project Is not selected as an engine page

Validate and write a scan-ready copy

The following illustrative script validates top-level pages and writes their transformed fences to scan-docs/. It registers the tags, variables and partials used by this small project. It also combines JavaScript blocks in page order because the engine runs each JavaScript block in a separate Node process.

// Validate every Markdoc page, then write a scan-ready copy of its code
// fences with variables, partials and if/else already resolved.
import fs from "node:fs";
import path from "node:path";
import Markdoc from "@markdoc/markdoc";

const docs = "docs";
const out = "scan-docs";
const partialDir = path.join(docs, "partials");

const partials = {};
for (const name of fs.readdirSync(partialDir)) {
  partials[name] = Markdoc.parse(fs.readFileSync(path.join(partialDir, name), "utf8"));
}

const config = {
  tags: {
    tabs: { render: "div", children: ["tag"] },
    tab: { render: "section", attributes: { label: { type: String, required: true } } },
  },
  variables: { version: "2.1.0", flags: { esm: false } },
  partials,
};

function fences(node, found = []) {
  if (Array.isArray(node)) node.forEach((n) => fences(n, found));
  else if (node && typeof node === "object") {
    if (node.name === "pre") {
      found.push({ lang: node.attributes["data-language"] || "text", code: node.children.join("") });
    } else fences(node.children, found);
  }
  return found;
}

let errors = 0;
fs.rmSync(out, { recursive: true, force: true });
for (const file of fs.readdirSync(docs).filter((f) => f.endsWith(".md"))) {
  const ast = Markdoc.parse(fs.readFileSync(path.join(docs, file), "utf8"));
  for (const e of Markdoc.validate(ast, config)) {
    if (e.error.level === "debug") continue;
    errors++;
    console.error(`${docs}/${file}:${(e.lines[0] ?? 0) + 1} ${e.error.level} ${e.error.id}: ${e.error.message}`);
  }
  const blocks = [];
  for (const b of fences(Markdoc.transform(ast, config))) {
    // The scan runs each js block in its own Node process, so keep one js
    // block per page with the page's code in order.
    const js = blocks.find((x) => x.lang === "js");
    if (b.lang === "js" && js) js.code += "\n" + b.code;
    else blocks.push(b);
  }
  const body = blocks.map((b) => "```" + b.lang + "\n" + b.code.replace(/\n$/, "") + "\n```\n").join("\n");
  fs.mkdirSync(out, { recursive: true });
  fs.writeFileSync(path.join(out, file), `# ${file}\n\n${body}`);
}
console.log(errors ? `${errors} problem(s)` : "no problems; scan-docs written");
process.exit(errors ? 1 : 0);

The script is a starting point with concrete limits:

  • It uses one set of variable values and one flag setting per run. Run it once for each flag combination you publish.
  • It reads only top-level .md files in docs/, not subfolders or .mdoc files.
  • It registers only the tags and partial setup used here. Supply your site’s real tags, nodes, functions and variables; otherwise validation can report unknown tags or transform a different page.
  • It merges all JavaScript blocks on a page in order. Review whether that models each published example and whether combining blocks changes their meaning.
  • It writes tab variants as separate blocks without grouping them. Test the alternatives deliberately.
  • Regenerate scan-docs/ in CI and do not edit it by hand. With --docs-dir scan-docs, the original docs/ directory is not scanned.

Generate the copy and plan its scan with the following commands. For an execution run, arrange the package setup and execution options described in the CLI reference.

node tools/check-docs.mjs
docsalive scan . --docs-dir scan-docs

The script reported successful validation and wrote the copy.

no problems; scan-docs written

With the network off, the engine-driver probe read two pages and five blocks from the generated scope. The install command was skipped for network access, the alternate package-manager command was skipped as a missing tool, the JSON block parsed with the resolved version, the combined JavaScript block passed, and the Markdown block was non-executable.

The generated usage page makes the changed test boundary visible. The partial’s setup comes first and only the active else branch remains. The literal tag stays in the non-executable Markdown fence because the source requested plain treatment.

# usage.md

```js
const { toKiB, formatSize } = require("acme-units");

console.log(toKiB(2048));

console.log(formatSize(1536));
```

```markdown
npm install acme-units@{% $version %}
```

This copy is a test artifact, not a substitute for checking the rendered site. It contains fences, not the full reader experience. Check tab behavior, explanatory prose, links and presentation separately. The static site guide and Starlight guide discuss related site-level coverage.

Test structural and code failures separately

The first failure below is broken on purpose: the first closing tab tag was removed from the install page. Markdoc validation reported three structural problems and the script exited with status 1.

docs/install.md:7 critical missing-closing: Node 'tabs' is missing closing
docs/install.md:8 critical missing-closing: Node 'tab' is missing closing
docs/install.md:17 critical missing-opening: Node 'tag' is missing opening
3 problem(s)

Run validation in CI on each pull request so a broken tag is caught close to the edit. Pass the same configuration the site uses; a validation result based on a simplified configuration may not reflect the actual build.

The second failure is broken on purpose in a different way. The library export is renamed while the documentation remains unchanged.

-function formatSize(bytes) {
+function formatBytes(bytes) {
@@
-module.exports = { toKiB, formatSize };
+module.exports = { toKiB, formatBytes };

Markdoc validation still passed because it did not run the JavaScript. The scan of the transformed copy failed its combined JavaScript block as runtime-error, a finding needing review. A raw-source scan also produced an invalid-syntax finding for the branch that this flag setting did not publish. That latter result illustrates why selecting the rendered branch matters when interpreting a scan.

The transformed-copy failure was the following Node error:

TypeError: formatSize is not a function

Review the intended API and the page together. If the rename is intentional, update the partial and examples; if it is accidental, restore the export. Then regenerate the copy and rerun validation and execution. The JavaScript guide covers additional Node-oriented example checks.

Triage findings

Finding Likely cause What to do
Missing-closing validation error A tag was not closed as the configured structure requires Fix the source and rerun validation with the site configuration
Valid source but runtime error Validation did not execute the example Test the transformed code against the intended package
Missing name in raw usage page Setup lives in a partial the engine did not expand Transform with registered partials before scanning
Failure in a hidden branch Raw scan planned all branches Generate and test each published flag combination
Literal version tag in a command Raw scan did not substitute the variable Use a transformed copy with the release value
JSON passes with a tag string The raw string is valid JSON Verify the transformed value and release configuration separately
A tab alternative was not tested as intended Custom tabs were not grouped Select and test each alternative deliberately
No findings from an .mdoc page The engine did not select it as a page Include it in your own generation workflow and verify the generated scope

Where DocsAlive fits

Use Markdoc to validate and transform the source using the site’s real configuration. Use DocsAlive on a deliberately generated page set for supported executable blocks and categorized findings. The scan can isolate each page in a fresh container, but the example package must be available in that environment. The generated copy should preserve the setup a reader needs rather than silently supplying unrelated state.

For plain projects, the engine normally scans docs/ plus the root README when docs/ exists. A partials directory is not automatically excluded, which is why the raw probe treated the partial as a page. With the generated directory selected through --docs-dir, review both the generated pages and the root README in the scope. See framework support and findings for the engine’s current boundaries.

A scan does not replace a Markdoc build or a human review of the published page. It can help find broken supported examples after the transformation has selected the content readers receive. The Deno guide and Sybil guide show why runtime and parser semantics also need their own checks.

Markdoc documentation test checklist

[ ] Validate source with the same tags, nodes, functions, and variables as the site.
[ ] Register the partials used by each page.
[ ] Generate a scan-ready copy from Markdoc's transform in CI.
[ ] Include every published flag combination in the test plan.
[ ] Include nested pages and other file suffixes in your own generator as needed.
[ ] Review how combined JavaScript blocks model the reader's path.
[ ] Test custom tab alternatives deliberately.
[ ] Confirm variables resolve to the intended release values.
[ ] Scan the generated scope and review skipped blocks and findings.
[ ] Inspect the rendered site and its explanatory prose separately.

The sources we checked

These sources were read on November 15, 2026. Engine behavior was checked against engine 0.6.3 on the same day.

Source What it covers
Markdoc syntax Tags, annotations, fences and comments
Markdoc tags Built-in and custom tags
Markdoc nodes Node configuration and fence attributes
Markdoc variables Variable values and resolution
Markdoc partials Registering and using partials
Markdoc validation Validation errors and custom checks
Markdoc rendering Parse, transform and render phases

FAQ

Does Markdoc validation run code examples?

No. Validation checks the parsed document against configuration. Execute the relevant transformed examples separately to check whether their code works.

How does DocsAlive handle raw Markdoc?

Engine 0.6.3 does not substitute variables or expand partials. It scans partial files as separate pages, plans every if/else branch, does not group custom tabs, and does not select .mdoc files as pages. A scan-ready copy can resolve these features before scanning, within the generator's stated scope.

Why test transformed fences?

Variables, partials and conditions can make the published code differ from the raw source. Transforming with the site's configuration gives the test a closer representation of one published page.

Does the sample script cover every page and variant?

No. It reads top-level .md files and uses one set of values per run. Adapt it for your project, run each published flag combination, and test tab alternatives deliberately.

Why combine JavaScript blocks in the generated copy?

The engine runs each JavaScript block in its own Node process. Combining the illustrative page's blocks preserves the setup order for that probe, but you must check that combining blocks models your own examples correctly.

What does the process=false annotation do?

It makes Markdoc treat the fence content as plain text rather than resolving tags within it. That is useful when a page needs to show the tag itself.

Keep reading
Outlined documentation pages with a lime pulse line running out of the stackGuide

Docs Testing: How to Test the Code Samples in Your Docs

Why code examples in documentation break, the ways teams test them (doctest, docs-as-tests, CI runners) and how to run every sample on each release.

Two lenses held over the same documentation page, each bringing a different layer into focusComparison

Vale vs markdownlint: What Each Docs Linter Catches

Vale checks prose style; markdownlint checks Markdown structure. What each catches, sample configs, running both in CI and what neither one tests.

Blueprint of two documentation pages: one with a handwritten test script, one whose code blocks are framed and checkedComparison

Doc Detective vs DocsAlive: Testing the Code in Your Docs

Doc Detective is a free, open-source docs-as-tests framework; DocsAlive is a hosted docs CI for code examples. Features, price, setup and when to use each.

A machine blueprint above a ruled documentation page, with a caliper measuring between themComparison

Promptless Alternative: Promptless vs DocsAlive Compared

Promptless drafts docs updates from what you ship; DocsAlive runs the code examples you've published. Features, pricing, security and when to use each.

A long workbench of outlined testing instruments, each with a small lime light, beside a stack of documentation pagesGuide

Best Free Tools to Test Code Examples in Documentation

Free, open-source tools that run the code examples in your docs: rustdoc, Go examples, doctest, pytest plugins, Sphinx doctest, Doc Detective and byexample.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing SDK Docs Before Every Release: A Release-Gate Guide

Test SDK and client-library docs against the package you ship: build the wheel or npm tarball, install it clean, run every example, and gate the release in CI.

Outlined documentation pages with a lime pulse line running out of the stackGuide

How to Test Quickstarts and Tutorials in Your Docs

Test the onboarding path a new reader follows: run quickstarts in a clean environment, in page order, sort real bugs from credentials and fragments, and wire it into CI.

Outlined documentation pages with a lime pulse line running out of the stackGuide

How to Test CLI Documentation: Commands, Flags and Output

Test the commands a CLI page promises: install in a clean container, run examples in order, compare flags with --help, check exit codes and output, and run it in CI.

Outlined documentation pages with a lime pulse line running out of the stackGuide

How to Test API Reference Docs: Requests, Responses and SDKs

Test API reference pages against the contract they publish: methods, parameters, request and response examples, SDK snippets, status codes and OpenAPI samples.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Docs testing for API-first companies

Keep API quickstarts, SDK snippets and curl examples working across releases.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Docs testing for CLI and developer-tool vendors

Test developer-tool install paths, package managers and command examples across releases.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing README Code Examples: Install, Usage and CI

Keep README install commands and usage examples working with clean environments, output checks and CI.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Notebooks and Executable Docs: Cells, Kernels and Output

Test notebooks in fresh kernels, check meaningful output and manage dependencies, data and drift in CI.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Docs in GitHub Actions: Pull Requests and Scheduled Checks

Run documentation example checks in GitHub Actions with practical guidance on schedules, path filters, caching, secrets and reports.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Code Examples in MkDocs, Docusaurus and Sphinx Sites

Find and test documentation examples in Markdown, MDX and reStructuredText, alongside site builds and link checks.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Python Docs Testing: Doctest, Pytest and Markdown

Test Python documentation with doctest, pytest, Markdown example execution and isolated environments.

Outlined documentation pages with a lime pulse line running out of the stackGuide

JavaScript Docs Testing: Node, TypeScript and Modules

Test Node and TypeScript documentation examples across module formats, package versions and type checks.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Go documentation examples

Test Go example functions and Markdown snippets against the intended module versions in clean environments.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Sphinx Docs Testing: doctest, code-block and MyST

Test Sphinx documentation examples: what the doctest and linkcheck builders prove, code-block and literalinclude, MyST fences, and what a Markdown scan covers.

Outlined documentation pages with a lime pulse line running out of the stackGuide

ReadMe Docs Testing: CLI, OpenAPI and Code Examples

Test ReadMe documentation examples: docs-as-code and bi-directional sync, what lint and oas:validate prove, Tabs variants and runnable code.

Outlined documentation pages with a lime pulse line running out of the stackGuide

TypeScript Docs Testing: tsc --noEmit and Runtime

Test TypeScript documentation examples: type-check snippets with tsc --noEmit in a consumer project, then run them, and what each check proves.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Docusaurus Docs Testing: Code Blocks, Tabs and MDX

Test Docusaurus documentation examples: builds vs runnable code, code block metadata, Tabs install variants, MDX pages and clean-container runs.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Mintlify Docs Testing: CodeGroup, Tabs and the CLI

Test Mintlify documentation examples: docs.json, MDX pages, CodeGroup and Tabs variants, what mint broken-links and mint validate prove, and clean runs.

Outlined documentation pages with a lime pulse line running out of the stackGuide

MkDocs Docs Testing: Code Examples, Tabs and Snippets

Test MkDocs documentation examples: strict builds, Material tabs, Snippets includes, mkdocstrings pages and clean-container runs.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Installation Instructions: pip, npm and Containers

Test documented install steps in clean environments: pip and extras, venv, npm install vs npm ci, containers and the first import.

Outlined documentation pages with a lime pulse line running out of the stackGuide

AI SDK Docs Testing: LLM Examples, Keys and Drift

Test AI and LLM SDK documentation examples: requests, responses, streaming, tool calls, credentials, model retirements and CI.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing migration guides and changelog examples

Test before and after examples against the right releases and make migration documentation part of the release gate.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Docs Testing Checklist: Code Examples Before Release

A practical pre-release checklist for testing documentation examples, reviewing gaps and verifying published packages.

Outlined documentation pages with a lime pulse line running out of the stackGuide

The Cost of Broken Code Examples in Documentation

Understand how broken documentation examples create friction in developer adoption and support, and how to reduce it.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Rust documentation examples

Test Rust rustdoc examples and cargo documentation tests, and keep native Rust checks because compiled Rust fences are recognized but not executed.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing VitePress documentation examples

Test VitePress Markdown examples separately from the site build, including code groups, includes and what a plain Markdown scan covers.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing docs in GitLab CI

Run documentation example checks in GitLab CI jobs, keep site builds separate from execution, and review what a scan covers and skips.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing JSON, TOML and YAML examples in docs

Test JSON, TOML and YAML config examples in documentation: parse, schema and tool checks, honest fence labels, fragments, CI jobs and what a scan covers.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Java documentation examples

Test Java examples in READMEs, SDK docs and Javadoc: the source launcher, javac, JShell scripts, assertions, @snippet files, CI and what a scan covers.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing PHP documentation examples

Test PHP examples in docs: php -l lint, clean-directory runs, assertions with zend.assertions, Composer scratch projects, PHPUnit, CI and scan coverage.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing C# documentation examples

Test C# examples in docs: .NET 10 file-based apps, dotnet build with warnings as errors, test projects, XML doc comments, CI and scan coverage.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Ruby documentation examples

Test Ruby examples in docs: ruby -c syntax checks, clean-directory runs, bundler/inline, minitest assertions, YARD examples, CI and scan coverage.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Kotlin documentation examples

Test Kotlin examples in docs: kotlinc runnable JARs and scripts, -Werror, KDoc @sample in compiled source, kotlinx-knit, fence labels, CI and scan coverage.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Swift documentation examples

Test Swift examples in docs: swift scripts, swiftc -typecheck, DocC snippets compiled by swift build, Swift Testing assertions, CI containers and scan coverage.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing curl and HTTP examples in API docs

Test curl examples in API docs: --fail-with-body, status and JSON checks against a local stub, http fences, credentials and what a docs scan checks.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Astro Starlight documentation examples

Test code examples in Astro Starlight docs: src/content/docs inventory, Tabs and Expressive Code, Markdoc pages, a Node check script, CI and scan coverage.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Nextra documentation examples

Test code examples in Nextra docs: content/ and app/ sources, fence metadata, Tabs and npm2yarn, a Node check script, CI and an honest scan limitation.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Docs testing for open-source projects

Test the code examples in open-source docs and READMEs: pull requests from forks, release and scheduled checks, contributor guidelines, triage and the Open source plan.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Docs testing for technical writers and docs teams

How technical writers and docs teams test the code examples they publish: docs-as-code checks, style-guide rules, reading a report, routing findings to engineers.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Docs testing for DevRel teams

How developer advocates test quickstarts, tutorials, workshops and sample READMEs: an inventory, a launch and release cadence, reading a report, and honest reporting.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Hugo documentation examples

Test the code examples in Hugo docs: fences with brace options, the highlight shortcode, Docsy tabs, drafts and theme example sites, scan scope and CI.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing GitBook documentation examples

Test the code examples in GitBook docs synced to Git: the space root, code tags, tabs, reusable includes, invisible characters, scan scope and CI.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing SQL examples in documentation

Test SQL examples in docs: run fences in page order on a fresh database, assert results, handle dialects, SQLite STRICT typing, psql ON_ERROR_STOP and CI.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing mdBook documentation examples

Test the code in an mdBook: what mdbook test covers, rust attributes, hidden lines, include directives, untagged output fences and a scan-ready copy for CI.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Docsify documentation examples

Test the code examples in Docsify docs: embedded code files and fragments, docsify-tabs tab sets, Prism grammars, scan scope and a CI check.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Jekyll documentation examples

Test the code examples in Jekyll docs: include tags, site variables, highlight tags, posts and _site copies, a scan-ready copy and Ruby hooks.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Antora and AsciiDoc documentation examples

Test the code examples in Antora docs: example includes, tagged regions, attributes, failing the build on missing includes and a Markdown copy to scan.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Fumadocs documentation examples

Test the code examples in Fumadocs docs: npm fences and package-manager tabs, tab groups, the Tabs component, includes, pycon highlighting and a scan-ready copy.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing versioned Docusaurus docs

Test every Docusaurus version readers can reach: versioned_docs copies, versions.json, partials, tabs, per-version scans and old-version triage.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Read the Docs documentation examples

Test the code examples on a Read the Docs site: .readthedocs.yaml build jobs, a pycon gate, latest and stable versions, Sphinx, MyST and .rst coverage.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Eleventy documentation examples

Test the code examples in Eleventy docs: Liquid pre-processing, global data, include tags, ignored drafts, raw tags and a rendered copy to scan.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Zola documentation examples

Test the code examples in Zola docs: Tera content templating, raw tags, config values, hide_lines, drafts, blog posts and a scan-ready copy.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Quarto documentation examples

Test the code examples in Quarto docs: executable cells, display-only fences, freeze and _freeze, a CI profile, cell options and a copy to scan.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Hexo documentation examples

Test the code examples in Hexo docs: posts, drafts, scaffolds, codeblock and include_code tags, a build check and a scan-ready copy.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing pdoc documentation examples

Test the code examples in pdoc docs: doctest for >>> sessions, fenced docstring examples, the README, private items and a copy to scan.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Doxygen documentation examples

Test the code examples in Doxygen docs: compiled example files, snippets, Markdown pages, WARN_AS_ERROR and what a scan can and cannot check.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing TypeDoc documentation examples

Test the code examples in TypeDoc docs: example tags, includeCode regions, project documents, a compiler check of extracted examples and a scan.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing JSDoc documentation examples

Test the code examples in JSDoc docs: example tags, captions, source patterns, tutorials, a doclet export and a scan-ready copy with assertions.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing docs examples with pre-commit hooks

Check docs code examples with pre-commit: local hooks, files filters, always_run, pass_filenames, SKIP and --no-verify, and what to leave for CI.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing documentation examples with Deno

Run docs code examples with deno test --doc: JSDoc and Markdown examples, imports, hashbang permissions, ignored blocks and deno check --doc-only.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing documentation examples with Sybil

Test Python docs examples with Sybil and pytest: Markdown parsers, invisible setup, skips, clear-namespace, docstrings and pycon fences a scan can read.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Markdown examples with phmdoctest

Test Python examples in README and Markdown files with phmdoctest: sessions, output blocks, directives, --report, generated pytest files and pycon fences.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Markdown code blocks with pytest-markdown-docs

Run Markdown python fences as pytest tests with pytest-markdown-docs: globals hook, fixtures, continuation, notest, retry and pinning the released version.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing command line docs with prysk and Cram

Test CLI docs with prysk and Cram: .t transcripts, exit statuses, (re) and (glob) matches, and generating tests from the console blocks in your Markdown.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Python docstring examples with xdoctest

Run docstring examples with xdoctest: the pytest plugin, google and freeform parsing, permissive output matching, directives, and what it does not check.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing multi-language docs examples with byexample

Test docs examples with byexample: prompt-based language detection, the -l selection, +pass, +skip and timeouts, capture tags, and hidden setup in comments.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Markdown code blocks with mktestdocs

Run Markdown code blocks under pytest with mktestdocs: exact fence labels, memory=True for shared state, bash blocks, custom executors and docstring checks.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing README code blocks with pytest-codeblocks

Run README and Markdown code blocks with pytest-codeblocks: exact python, sh and bash labels, cont, skip and xfail markers, expected output, and gaps.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Markdown code examples in any language with txm

Test annotated Markdown examples with txm: program, in, out, err, check and exit annotations, TAP output, exact matching, and blocks it never runs.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Sphinx docs examples with sphinx.ext.doctest

Run Sphinx doctest, testcode and testoutput directives in reStructuredText or MyST pages: groups, hidden setup, global setup and what is never run.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing docs examples that need API keys

Test credential-gated docs examples: honest placeholders, offline stubs and fixtures, live sandbox jobs, CI secrets and fork rules, and how a scan classifies them.

A machine blueprint above a ruled documentation page, with a caliper measuring between themGuide

Documentation Drift: How to Detect It Before Users Do

What documentation drift is, why code examples drift first, and practical ways to detect it: ownership, release checks, link and execution tests.

See which of your code samples still run.

Send us a public repository. Our team runs DocsAlive on its docs and emails you the real report within 2 business days. Free, no signup.