Guide

Testing Read the Docs documentation examples

A green Read the Docs build is not an example test. Gate what must pass, scan the tag behind stable, and know what Sphinx sources a scan misses.

Published
Updated
November 17, 2026
Reading time
15 min
Facts checked against
Read the Docs docs on the v2 configuration file, build customization, versions, pull request builds and environment variables, plus MyST, MkDocs, doctest and git worktree docs, with every code block run on MkDocs 1.6.1, Sphinx 9.2.0, MyST-Parser 5.2.0 and Python 3 (November 13, 2026)
Outlined documentation pages with a lime pulse line running out of the stack
On this pageThe short answerWhat Read the Docs buildsAdd a narrow example gateWhy examples break after publicationScan the MkDocs sourceCheck Sphinx and MyST coverageTriage findings by reader impactPut build and scan checks togetherWhere DocsAlive fitsThe sources we checkedFAQ

The short answer

Build your Read the Docs site and test its examples as separate checks, with explicit coverage for the branches and tags readers see. In engine 0.6.3, DocsAlive detects MkDocs and adds the root README, but it does not read .readthedocs.yaml, run build.jobs, or know which Read the Docs versions are active. A Git URL scan uses the default branch, corresponding to latest; scan a local checkout of the selected tag to check stable. Sphinx is not detected, .rst pages are never scanned, and MyST code-block directives are skipped as not executable.

A Read the Docs build checks whether the configured documentation process can produce a site. It does not automatically run every example a reader can copy. A page can render perfectly while an import is obsolete, a promised value is wrong, or a command depends on an undocumented prerequisite.

The walkthrough uses an illustrative MkDocs project with a small pycon gate, followed by a Sphinx and MyST project. The Read the Docs build itself was not run on the service. The two relevant steps were run locally, and the configuration was validated against the published v2 schema. Those checks provide useful evidence, but they do not establish the result of a hosted build.

What Read the Docs builds

Read the Docs takes its configuration from .readthedocs.yaml. The configuration shown here declares version 2, a build operating system, and a Python tool version. The build.jobs section adds commands at build steps such as pre_build; a command that returns a nonzero exit code fails the build immediately. When using jobs, build.os and build.tools are required. The configuration reference and build customization guide describe these settings.

The mkdocs key can name the MkDocs configuration and request failure on warnings. A Sphinx project can instead use the sphinx key and its configuration setting. The python.install section can install from a requirements file. Keep the environment and dependencies in view when interpreting a test: an example that works on a maintainer's machine may need a dependency or runtime that is absent from the configured build.

Read the Docs versions are based on Git tags and branches. latest points to the default branch. stable tracks the greatest stable semantic-version tag or branch, preferring tags and excluding prereleases. Do not assume that a fix on the default branch has reached the tag currently serving stable. Check the actual version selection for the project when deciding what to test. See the versions documentation.

Pull request previews build a new version when a pull request opens and rebuild on new commits. Read the Docs reports a success or failure status check on the pull request. That status represents the configured build, including any explicit gate you add; it does not by itself promise coverage of every code sample. See pull request builds.

During a Read the Docs build, READTHEDOCS is set to True and READTHEDOCS_VERSION contains the version slug; for a pull request build it contains the pull request number. Use those facts carefully when diagnosing environment-dependent behavior, and avoid assuming that a local run has the same environment. The environment variable reference describes their meaning.

Add a narrow example gate

The following illustrative .readthedocs.yaml was validated against the published v2 JSON schema. Its pre_build job invokes a script that checks pycon blocks. The hosted Read the Docs build was not run for this probe.

version: 2

build:
  os: ubuntu-24.04
  tools:
    python: "3.13"
  jobs:
    pre_build:
      - python scripts/check_pycon.py docs

mkdocs:
  configuration: mkdocs.yml
  fail_on_warning: true

python:
  install:
    - requirements: docs/requirements.txt

The illustrative mkdocs.yml names two pages. MkDocs configuration controls the site and navigation; it does not make those pages' code examples executable tests by itself. See the MkDocs configuration guide.

site_name: Example Client
nav:
  - Home: index.md
  - Usage: usage.md

The illustrative requirements file pins the MkDocs version used in the local check:

mkdocs==1.6.1

The first illustrative page, docs/index.md, contains a shell command and a Python block. They are useful reader instructions, but the narrow doctest gate introduced below does not test either block.

# Example Client

Check your Python version:

```bash
python3 --version
```

Build a settings dictionary:

```python
settings = {"retries": 5, "timeout": 10}
print(settings["retries"])
```

The second illustrative page, docs/usage.md, contains a pycon session with an expected value. That is the format the gate is designed to find.

# Usage

Sort the keys of a settings dictionary:

```pycon
>>> settings = {"timeout": 10, "retries": 3}
>>> sorted(settings)
['retries', 'timeout']
```

The illustrative scripts/check_pycon.py uses Python's doctest module to find and run matching sessions under the supplied directory. It exits with a failure if a doctest fails. The script is intentionally narrow: it matches the fence form shown here in .md files, rather than proving coverage of every page or example format. See the doctest documentation.

import doctest
import re
import sys
from pathlib import Path

FENCE = re.compile(r"^```pycon\n(.*?)^```", re.M | re.S)
parser = doctest.DocTestParser()
runner = doctest.DocTestRunner(optionflags=doctest.ELLIPSIS)
for page in sorted(Path(sys.argv[1]).rglob("*.md")):
    for n, block in enumerate(FENCE.findall(page.read_text()), 1):
        test = parser.get_doctest(block, {}, f"{page}#{n}", str(page), 0)
        runner.run(test)
failed, attempted = runner.summarize(verbose=False)
print(f"{attempted} pycon examples, {failed} failed")
sys.exit(1 if failed else 0)

Run the same two steps locally before pushing. Both exited successfully in the checked environment, using MkDocs 1.6.1 and Python 3.13.

python scripts/check_pycon.py docs
mkdocs build --strict

The local doctest check reported two attempted examples and no failures:

2 pycon examples, 0 failed

Now consider a deliberately broken expectation. The next block is the local check's result after changing the expected order in usage.md. The check exited 1. If this command returned that status in the configured pre_build job, Read the Docs would fail the build at that point.

**********************************************************************
File "docs/usage.md", line 2, in docs/usage.md#1
Failed example:
    sorted(settings)
Expected:
    ['timeout', 'retries']
Got:
    ['retries', 'timeout']
**********************************************************************
1 item had failures:
   1 of   2 in docs/usage.md#1
***Test Failed*** 1 failure.
2 pycon examples, 1 failed

This is a useful build gate because it has a clear contract: matching pycon sessions must pass before the site build proceeds. It is not a general documentation test. It does not execute the ordinary Python and shell blocks above, inspect .rst files, or establish that a multi-page tutorial works from start to finish. Expand coverage deliberately, with checks appropriate to the formats and reader journeys your project supports.

Why examples break after publication

A common failure starts with a healthy default branch and an older stable tag. A maintainer corrects a page on the branch, the latest build updates, and the stable site continues to serve the tagged copy. If nobody checks that tag again, readers can encounter the old instruction even while the current source looks correct.

Dependencies and runtimes can drift too. A page may describe an API available when the tag was created, but the build or a reader's environment may now install a newer dependency. Conversely, an example for an old release may legitimately need an older artifact. Record the artifact, interpreter, dependencies, fixtures, and network assumptions before deciding whether a failure belongs in the documentation.

A successful site build only establishes what its configured steps check. Sphinx can render a directive as highlighted code without executing it. A page written in .rst can publish successfully without being seen by a Markdown-only scanner. An explicit doctest gate covers the sessions it discovers, but any remaining formats need their own plan. For Sphinx's doctest builder, see testing Sphinx docs; for a wider MkDocs workflow, see testing MkDocs docs.

Scan the MkDocs source

The following command plans an illustrative repository scan:

docsalive scan .

In the checked project, DocsAlive detected MkDocs, collected three pages—the root README and the two files under docs/—and found three blocks. When executed, all passed. With the deliberately wrong pycon expectation above, the engine instead reported that block as a warning in the output-differs category, while the doctest gate exited 1. Both identified the same block, but they assigned different severity.

Only pycon sessions have their printed output compared by the engine. A warning still deserves review when the documented value is central to the reader's task. Conversely, decide whether variable content is intended before treating every difference as a documentation bug.

The scanner does not read .readthedocs.yaml, execute build.jobs, or discover active Read the Docs versions. A scan and a hosted build therefore need separate configuration and separate evidence. Inspect the report's page list and reasons, including skipped blocks, rather than assuming that a successful scan mirrors the site build.

A Git URL target is shallow-cloned at the default branch, which corresponds to what Read the Docs calls latest. To check a stable tag, use a local checkout of the tag. The following illustrative commands created a tag and worktree for the probe, then planned a scan of that checkout:

git tag v1.2
git worktree add ../docs-v1.2 v1.2
docsalive scan ../docs-v1.2

The checked worktree contained the tagged settings, while the default branch had moved on. The scan detected MkDocs and collected three pages at the tagged commit. For an existing project, identify the actual tag selected for stable and scan that checkout; creating a new tag would be a separate release action, not a prerequisite for inspecting an existing one. The Git worktree reference explains the checkout mechanism.

The commands shown plan scans. Use the execution option documented in the CLI reference when the purpose is to run examples, and record the commit and setup with the resulting report. A default-branch scan cannot establish what a different tag serves.

Check Sphinx and MyST coverage

Sphinx creates a different coverage problem in engine 0.6.3. The engine does not detect Sphinx as a framework. It can collect Markdown pages as plain Markdown, but it never collects .rst pages. A MyST directive can render correctly in Sphinx while the engine reads the directive's fence as text and skips it.

The illustrative MyST page below contains both a plain Python fence and a code-block directive. In the checked Sphinx build, both rendered as highlighted Python and the directive's caption appeared.

# Example Client

A plain Python fence:

```python
settings = {"retries": 3, "timeout": 10}
print(settings["retries"])
```

The same code as a MyST code-block directive with a caption:

```{code-block} python
:caption: settings.py

settings = {"retries": 3, "timeout": 10}
print(settings["timeout"])
```

This illustrative docs/usage.rst belongs to the same project. It is a separate coverage gap for the engine because .rst is not a scanned page suffix.

Usage
=====

.. code-block:: python

   print("hello from rst")

Build the Sphinx site and plan the scan:

sphinx-build -q -b html docs _build/html
docsalive scan .

The local Sphinx build exited successfully with a warning that usage.rst was not in a toctree. The scan reported framework plain, collected only docs/index.md, and found two blocks. When executed, the plain Python fence passed; the directive was skipped as not executable text. The .rst page received no scan coverage. Rendering is therefore evidence about the site output, not proof that either sample was executed.

Make a scan-ready copy

The illustrative scripts/myst_scan_copy.py below creates a separate Markdown copy for scanning. It changes supported MyST directive fences into plain language fences and drops directive option lines such as a caption. It leaves the source pages in place.

import re
import sys
from pathlib import Path

src, dst = Path(sys.argv[1]), Path(sys.argv[2])
DIRECTIVE = re.compile(r"^(`{3,})\{(?:code-block|code|sourcecode)\}\s+(\S+)\s*$")
for page in sorted(src.rglob("*.md")):
    out, lines, i = [], page.read_text().splitlines(), 0
    while i < len(lines):
        m = DIRECTIVE.match(lines[i])
        if m:
            out.append(m.group(1) + m.group(2))
            i += 1
            while i < len(lines) and lines[i].startswith(":"):
                i += 1
            if i < len(lines) and not lines[i].strip():
                i += 1
            continue
        out.append(lines[i])
        i += 1
    target = dst / page.relative_to(src)
    target.parent.mkdir(parents=True, exist_ok=True)
    target.write_text("\n".join(out) + "\n")
    print(f"wrote {target}")

Create the copy and plan a scan of it:

python3 scripts/myst_scan_copy.py docs scan-docs
docsalive scan . --docs-dir scan-docs

The checked script completed successfully and reported the copied page:

wrote scan-docs/index.md

The scan-ready copy contained one page and two blocks; when executed, both Python blocks passed. Keep the original path and generated path associated in your test record so a finding can be reviewed against the source. The copied page is a testing aid, not proof that the published Sphinx page has the same execution context.

The script handles only code-block, code, and sourcecode directives whose first line names a language. It does not handle literalinclude, eval-rst, colon fences, or .rst pages. It removes option lines rather than interpreting their meaning. Review generated copies and use a separate Sphinx-aware check for material outside that scope. The MyST code documentation describes the source constructs.

Read the Docs or Sphinx item What Read the Docs does What the engine does in 0.6.3
.readthedocs.yaml Configures the hosted build, including the selected tools and jobs. Does not read it or execute its jobs.
MkDocs project Builds the site using the configured MkDocs settings. Detects MkDocs and collects docs/ plus the root README.
latest Builds the default branch. A Git URL scan shallow-clones the default branch.
stable Tracks the greatest stable semantic-version tag or branch, with tag preference and prereleases excluded. Does not select the active version; scan a local checkout of the appropriate tag.
Pull request preview Builds on opening and new commits and reports a status check. A separate scan must be configured for the desired source and scope.
Pycon gate in pre_build Fails the build if the command exits nonzero. Reports the checked mismatch as a warning categorized output-differs.
Sphinx and .rst Can build Sphinx source, including .rst pages. Does not detect Sphinx and never collects .rst pages.
MyST code-block directive Sphinx with MyST can render it as highlighted code. Skips the directive fence as not executable text unless a suitable scan copy is made.
Unknown fence label A site may render or display the block. Can report it as passing without running or parsing it; this is a known limitation.

The table describes the checked engine release. The exact hosted build still depends on the project's configuration, selected version, dependencies, and service environment.

Triage findings by reader impact

A failing gate, a scan warning, and a skipped block carry different evidence. Start with the source version and the reader's intended path. Then reproduce the result using the documented prerequisites and determine whether the problem is in the page, the test environment, or an external dependency.

Finding Team response Evidence to keep
A stable tag contains an incorrect example. Fix the applicable source and decide how the correction reaches readers of that release. Tag, commit, runtime, failure, and release policy decision.
Latest is fixed but stable is still wrong. Decide whether a corrected release or other supported publishing path is needed. The version each site serves and the tested artifact.
A pycon value differs. Decide whether the expected value is wrong or legitimately variable; choose gate severity accordingly. The session, environment, and reason for the decision.
A MyST directive or .rst page is untested. Add a suitable separate check and record the gap until it is covered. Source path, format, and check used.
A dependency, fixture, or network condition caused a failure. Reproduce and assess whether the page states the prerequisite. Setup supplied by the test and the relevant failure category.
A version is no longer supported. Decide whether to retain or retire it under the team's policy. Support decision and handling of existing links.

Do not silently update an old page to describe a newer product if that makes it inaccurate for the version the page claims to cover. Likewise, a warning is not automatically harmless when a reader is told to expect a precise result. The owner of the documentation should make those calls.

Put build and scan checks together

Use the build gate for the narrow checks that must prevent publication, and run DocsAlive beside it to inspect supported examples and classify findings. The scan is not inside Read the Docs. Make the branch or tag, setup, and collected page list visible in both workflows so reviewers can tell what each result covers.

For pull requests, a preview status helps reviewers see whether the configured site build succeeded. A separate example scan can provide findings for the changed source. For releases, identify the tag intended for stable and test that exact checkout. For existing stable releases, schedule a check when dependencies and supported environments can change.

Review skips as carefully as failures. The engine collects only .md, .mdx, and .markdown pages; it cannot cover .rst by itself. Unknown fence labels can appear to pass without being run or parsed. A clean summary is meaningful only when the selected pages and supported block formats match the coverage you intended.

Paste this checklist into a release or documentation issue:

[ ] Identify the default branch and the actual version selected for stable.
[ ] Record the commit, product artifact, runtime, and dependencies for each check.
[ ] Validate the Read the Docs configuration against the published schema.
[ ] Run the configured example gate and site build in a suitable environment.
[ ] Review the pull request preview status and any build warnings.
[ ] Scan the default branch for latest and a local tag checkout for stable.
[ ] Confirm the scan's collected page paths, including the root README for MkDocs.
[ ] Review pycon warnings, failures, skips, and unknown fence labels.
[ ] Inventory Sphinx .rst pages and MyST directives needing separate coverage.
[ ] Inspect any generated scan copy and map findings back to source.
[ ] Decide how fixes reach each supported version.
[ ] Save the build and scan results and record remaining coverage gaps.

Where DocsAlive fits

DocsAlive runs supported examples in isolated page environments and classifies results to help teams separate likely documentation defects from failures that need context. Reports identify the page, line, status, category, and reason. That makes the scan useful beside a build gate, especially when a repository contains examples beyond the gate's narrow pycon pattern.

It does not replace the Read the Docs build, select stable on your behalf, or cover every Sphinx source format in engine 0.6.3. Keep a separate build check, explicitly scan the relevant checkout, and maintain a coverage plan for .rst and directives. See the framework reference, findings reference, and documentation drift guide. For copied release folders rather than Git-based site versions, see testing versioned Docusaurus docs.

The sources we checked

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

Source What it covers
Read the Docs configuration reference Version 2 configuration, build tools, jobs, and documentation builders
Read the Docs build customization Adding commands to build steps and their effect on builds
Read the Docs versions Branches, tags, latest, and stable
Read the Docs pull request builds Preview builds and pull request status
Read the Docs environment variables Build and version environment values
MyST code and API syntax Code directives in MyST source
MkDocs configuration MkDocs site configuration
Python doctest Running and checking interactive Python sessions
Git worktree Creating a separate checkout of a selected commit or tag

FAQ

Does a successful Read the Docs build test every example?

No. A build runs the configured documentation steps and any checks you explicitly add. A Sphinx directive can render as code without executing it, and a narrow doctest gate only covers the sessions it finds.

Does DocsAlive run Read the Docs build jobs?

No. Engine 0.6.3 does not read .readthedocs.yaml or run build.jobs. Run the scan beside the build gate and review the result of each check separately.

How do I test the documentation served as stable?

Identify the tag or branch actually selected for stable, check it out locally, and scan that checkout with the appropriate setup. A Git URL scan uses the default branch, corresponding to latest, and does not select a tag.

What happens when a pycon value is wrong?

In the checked probe, the doctest gate exited with a failure that would fail its configured pre_build job. The engine reported the same mismatch as a warning in the output-differs category. Review the difference and choose the gate appropriate to the page's promise.

Can the engine scan Sphinx and MyST pages?

It does not detect Sphinx in engine 0.6.3 and never scans .rst pages. It scans MyST Markdown as plain Markdown, but skips code-block directive fences as not executable text. A limited scan-copy transformation can cover some directives; other constructs need separate checks.

Was the example configuration tested on Read the Docs?

The hosted build was not run. The configuration was validated against the published v2 schema, and the doctest and MkDocs build steps were run locally. A hosted run is still needed to verify the project's actual service environment and version settings.

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 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 Markdoc documentation examples

Test the code examples in Markdoc docs: variables in fences, partials, if/else, custom tabs, validate in CI and a scan-ready copy from transform.

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.