Guide

Docs testing for open-source projects

Run README and docs examples safely on pull requests from forks, check the published package at release, and catch drift on a schedule, with triage a small maintainer team can keep up with.

Published
Updated
November 17, 2026
Reading time
21 min
Facts checked against
GitHub Docs on workflow events, secure use, fork approvals, disabling workflows, code owners and contributor guidelines, the OSI license list and Python doctest (November 11, 2026)
Outlined documentation pages with a lime pulse line running out of the stack
On this pageThe short answerWhy open-source examples breakDecide what to test and whenMake examples easier to contribute and testRun forked pull request checks safelyA small GitHub Actions workflowTriage findings before assigning workFit the workflow to the projectWhere DocsAlive fitsPasteable maintainer checklistThe sources we checkedFAQ

The short answer

Test the examples readers actually follow: run important README and documentation paths in a clean environment when pull requests change docs or public APIs, check the published package at release, and repeat checks on a schedule to catch drift. Treat examples from forked pull requests as untrusted code, and separate likely docs bugs from fragments, credentials, missing fixtures and other results that need context.

Start with the installation and first-use path, then expand coverage as the project can maintain it. Record the package version, operating system, shell, setup and skipped steps for each run. A green result is useful only when maintainers can tell what was tested and what was left out.

DocsAlive extracts examples and runs supported blocks in page order, then classifies findings so maintainers can focus on likely documentation bugs. Its Open source plan provides weekly runs for eligible public projects. Compiled languages are not executed, TypeScript support is limited, and credential-gated examples are classified rather than run with real keys. The broader docs testing guide covers the same practice across project types.

Why open-source examples break

Open-source documentation changes through many routes. A contributor may fix a README typo, add an example for a new option, or copy a working command from an issue. A maintainer may merge the change after reviewing the prose and code but without having the contributor's operating system, credentials or local files. Even a careful review cannot recreate every reader's environment.

A few recurring gaps cause many failures:

Source of drift What a reader encounters Check that can expose it
Drive-by contributions A helpful snippet omits an import, assumes local state or uses an undocumented prerequisite Run the changed page from a clean starting point and review the setup
Renamed APIs An example calls an import, method or argument that changed between releases Exercise examples when the public API changes
Main branch versus published package Docs describe code merged on the default branch, but a reader installs a release that does not have it Test the release documentation against the published package
Dependency drift An example that once worked now encounters a changed dependency Repeat representative runs on a schedule
OS or shell assumptions A command uses shell syntax, paths or tools unavailable in the reader's environment State the environment and test the supported paths separately
Credentials and external services A reader needs a key, account or remote resource before a call can work Identify the prerequisite and keep a separate authorized integration check
Limited review time A small maintainer group must evaluate code, prose, CI output and contributor questions Prioritize high-traffic paths and classify failures before escalating them

These causes can overlap. A contributor might write an example against an unreleased API, test it on one operating system, and omit the installation step because the package is already present locally. A failure report saying only “command failed” leaves the maintainer to reconstruct all of those assumptions.

The goal is to make that reconstruction inexpensive. A useful report identifies the page and block, records the environment and installed version, and distinguishes a failure in the documentation from a condition the test could not satisfy. See documentation drift for the broader problem.

The README is part of the product

Readers often try the README before opening the full site. Its installation command, smallest example and links to further documentation deserve the same care as the code they describe. A broken import in that first example can stop a reader before they reach a more complete tutorial.

Treat the README as its own starting point. Do not let a test pass because an earlier documentation page installed a dependency or created a file that the README never mentions. If the README deliberately points to a setup guide, make that dependency clear. The README testing guide describes how to choose and check that first path.

Decide what to test and when

A practical test plan follows the promises the project makes to readers. For each important page, identify the package or binary to install, the starting environment, the sequence of commands, any required data and the observable result. Then decide which events should run that path.

When What to test What the result tells you
Pull request touching docs Changed complete examples, their prerequisites and nearby steps Whether the proposed documentation works under the stated setup
Pull request touching a public API Representative examples that use the changed imports, commands, options or behavior Whether existing documentation needs to change with the API
Release preparation Important paths against the artifact intended for release Whether the candidate artifact and release docs agree
After publication Installation and important examples against the published package or binary Whether a reader can obtain and use what actually shipped
Scheduled run Stable, high-value examples against the dependencies and installation path readers use Whether a change outside the repository has made an example stale

A pull request check and a release check answer different questions. A checkout can contain a new API that is absent from the latest published package. It is useful to test upcoming documentation against that checkout, but label it as upcoming or version-specific until readers can install the matching release. Conversely, a release check against an old local checkout does not establish that the published artifact contains the promised files.

For a release, record the exact artifact and version used. If the installation instructions refer to a public package, repeat the path against that package after publication. That post-publication result can reveal a packaging or publishing problem, but it cannot prevent a release that has already shipped. The installation docs testing guide and SDK docs testing guide cover those boundaries in more detail.

Scheduled checks serve a different purpose again. They can reveal that a dependency, remote service or install path changed while the project itself was quiet. A schedule should produce a result someone will review. If nobody owns the findings, a recurring failure can become background noise.

Choose a starting set

Do not make the first version of the process depend on testing every page. Start with the README, installation instructions, a first successful operation and one example for each public interface that users commonly reach first. Add migration instructions when a release changes behavior; those pages often need both an old and a new version of the package to be meaningful. The migration guide testing guide explains how to frame that comparison.

For each path, write down:

  • The version or artifact under test and how it was obtained.
  • The operating system, shell and relevant runtime.
  • The commands and setup a reader is expected to perform.
  • Files, services and credentials assumed by the page.
  • The expected result and any fields that can vary.
  • Steps that were skipped, with a reason and an owner for any follow-up.

A test may prepare a fixture to make an example runnable. Keep that preparation visible: if the fixture is necessary for a reader too, the page should explain where it comes from. Similarly, a test that installs a package before running a page should not hide a missing install instruction.

Preserve page order and page boundaries

A tutorial can define a variable in one block and use it later. Run those blocks in the order a reader encounters them, preserving the state that the tutorial establishes. Starting each block independently can turn a valid sequence into several misleading undefined-name failures.

At the same time, start separate pages independently unless the docs explicitly tell readers to carry state between them. An installation on one page should not silently make another page pass. If a journey crosses pages, record that relationship and test the journey as a separate path.

Tabs need an explicit choice too. Different tabs may be alternatives for different languages, shells or package managers. Running them in sequence can create a path no reader would follow. Record which alternative was checked and cover other important alternatives in separate runs.

Make examples easier to contribute and test

Contributor guidance turns review expectations into something a first-time contributor can follow. A short section in CONTRIBUTING.md can ask authors to identify the package version and environment they used, run complete examples, explain fixtures, mark omitted code and avoid real credentials. Include the command contributors should use for the project's own docs checks, along with a way to report a check they cannot run locally.

GitHub's contribution guidelines documentation describes where a repository can place these guidelines and how GitHub makes them discoverable. Keep the rules proportional to the project: a short, reproducible first-use example is more useful than a long policy contributors cannot apply.

A review guide might ask:

  1. Does the example target a released version, an upcoming version or a particular supported branch?
  2. Can a reader identify all imports, installation steps and required files?
  3. Is the fence labeled for the content it actually contains?
  4. Is any omitted code marked, and is the surrounding explanation clear?
  5. Are credentials represented by placeholders, with no real key in the repository?
  6. Has the author stated which operating system and shell the command assumes?
  7. If a check was skipped, does the pull request explain why?

Use honest fence labels and mark fragments

A fence label is a clue to both a reader and a checker. Use python for Python code, bash for Bash commands and pycon for an interactive Python session. Label a displayed result as output rather than presenting it as a command. Do not label a fragment as a complete program merely to make it look runnable.

A literal ellipsis can show that code has been omitted. Explain what the reader must supply around it. For example, a page can describe a larger function and say that ... represents omitted work. An automated result that skips a fragment is then an accurate description of coverage; it is not evidence that the omitted code works.

Use placeholders for sensitive values, and explain how a reader supplies a real value outside the documentation. Do not put a working key into a public example or ask a forked pull request check to use one. A placeholder also needs context: tell the reader whether it represents a token, a file path or a service address, and which step obtains or creates it. The credentials guide covers ways to separate a readable example from a credential-dependent integration check.

Show stable Python results with an interactive session

A pycon block can show both an expression and its expected result. This example needs only Python's standard library:

>>> from pathlib import PurePosixPath
>>> path = PurePosixPath("docs") / "guide-1.md"
>>> str(path)
'docs/guide-1.md'
>>> path.suffix
'.md'

Save the session as a text file to check it with Python's standard-library doctest:

cat > docs-session.txt <<'EOF'
>>> from pathlib import PurePosixPath
>>> path = PurePosixPath("docs") / "guide-1.md"
>>> str(path)
'docs/guide-1.md'
>>> path.suffix
'.md'
EOF
python -m doctest -v docs-session.txt

The Python doctest documentation describes how it finds interactive sessions and verifies their expected output. Choose stable values for examples intended for exact checking. A timestamp or a response whose ordering changes can distract from the behavior the page is trying to teach.

For an ordinary complete Python block, make its dependencies and result clear as well:

from pathlib import PurePosixPath

page = PurePosixPath("docs") / "guide-1.md"
assert page.suffix == ".md"
print(page.name)

This block runs with the standard library and prints guide-1.md. In a project guide, replace it with a small example of the real public interface and document the installation that makes that interface available. See the Python docs testing guide for a broader test plan.

Route review to people who know the docs

A CODEOWNERS file can associate documentation paths with maintainers or teams who understand the examples. GitHub requests code-owner review for changes to owned files, subject to the rules it describes for draft pull requests and the base branch. Owners need the appropriate repository access; a team must also be visible and have write access. An administrator or owner can configure required code-owner approval where appropriate. See GitHub's code owners documentation.

Ownership should make review easier, not turn one person into a bottleneck. A solo maintainer may simply review the README and public API paths personally. A larger project can assign related docs and code paths to a team, with a documented route for cases that cross ownership boundaries. Reviewers still need the test result and its limitations; a code-owner request does not establish that an example ran.

Run forked pull request checks safely

Documentation examples are code supplied through the repository. A pull request can change a snippet, a test script, setup commands or workflow files. Treat that content and pull request metadata as untrusted input when designing a check.

For checks that execute proposed examples, use a pull_request workflow with the permissions and resources the check actually needs. GitHub states that, for workflows triggered from a forked repository, secrets other than GITHUB_TOKEN are not passed to the runner, and the token has read-only permissions in pull requests from forks. Design the check to work without project secrets. Do not interpret a credential-gated example that was skipped as a successful live API call. See GitHub's workflow event reference.

pull_request_target requires particular care. GitHub warns that privileged workflows using pull_request_target or workflow_run with an untrusted checkout can expose a repository to compromise. Those workflows may have write access and access to referenced secrets, and share the main branch cache with other privileged workflows. GitHub recommends avoiding pull_request_target when it is unnecessary and avoiding these triggers with untrusted pull requests or code content. Do not check out and execute fork code in a privileged workflow. The secure use reference describes these risks and the associated guidance.

Untrusted input also includes values such as pull request titles and other event data. GitHub warns that inserting such values into an inline script can create script injection risks. Its guidance recommends using an action that accepts the value as an argument, or an intermediate environment variable when an inline script must handle it. Review any command that incorporates contributor-controlled data, even if it does not execute a fenced example.

Review approval requests

Depending on repository, organization or enterprise settings, a workflow run from a contributor's fork may require approval from a maintainer with write access. Before approving, inspect the proposed changes and pay particular attention to changes in the workflow directory. Approval means allowing the workflow to run on the proposed branch; it is a separate decision from accepting the contribution.

GitHub says runs awaiting approval for more than 30 days expire and are marked failed. A first-time contributor to a public repository may need a maintainer to approve the run. Document how contributors can ask for help if a check is waiting, and review the fork workflow approval instructions when setting the project's policy.

Keep scheduled checks visible

Scheduled workflows run on the default branch, so ensure that branch contains the documentation and workflow you intend to check. A schedule on the development branch does not by itself prove that every maintained release branch still matches its package.

In a public repository, GitHub automatically disables scheduled workflows after 60 days without repository activity. Scheduled workflows are also disabled by default when a public repository is forked. Check that the workflow remains enabled, and re-enable it when needed using the GitHub interface or the other methods described in GitHub's workflow management documentation. A missing scheduled result is a coverage gap, not a passing run.

A small GitHub Actions workflow

The following outline runs a repository-owned Python doctest file on pull requests and on a weekly schedule. It uses read-only repository contents permission and does not require credentials. Put the workflow in the repository and replace the test file path with a text file the project maintains. The file must exist in the checked-out repository.

name: Documentation examples

on:
  pull_request:
  schedule:
    - cron: "17 4 * * 1"

permissions:
  contents: read

jobs:
  docs-examples:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.12"
      - run: python -m doctest -v docs/examples.txt

This is a starting point, not a complete test of a site. It runs every pull request because it has no path filter; that also catches public API changes that might affect the example. The scheduled run checks the default branch. Add project-specific setup and checks only after deciding what code they execute and what they require.

The job tests the file in the checkout. If that file imports the project, arrange installation in the test environment and record whether the test uses the checkout or a published artifact. A separate release process should verify the package readers receive. This outline also does not cover other shells, operating systems, external services or every code block on a page. The GitHub Actions docs testing guide has more on designing a repository-specific workflow.

Triage findings before assigning work

A raw failure is an observation, not necessarily a documentation defect. A useful triage process asks what the page promised, what the test supplied and whether the result is reproducible under those conditions.

DocsAlive uses statuses to describe execution and categories to explain findings. A pass can mean a block executed or was syntax-checked; a warn can indicate differing output in a pycon session or a deprecation warning; a fail means the block exited with an error; and a skip records a deliberate decision not to run it. Read the category and reason alongside the status.

Finding Product category Maintainer response
A complete example imports an API absent from the installed version api-drift Check the intended version and correct the example or its version guidance
Complete code does not parse invalid-syntax Fix the code if it is meant to be executable; otherwise make the fragment clear
A documented package name does not exist package-not-found Verify the intended package and correct the installation instruction
A pycon session has output from an older runtime stale-output Reproduce under the stated runtime and update the session if it promises that result
A placeholder package or module is intentional illustrative Explain what it stands for; do not treat the placeholder as proof of an install failure
An example needs a key needs-credentials Explain how to supply one and use a separate authorized check for the live path
An example expects a local file missing-fixture Decide whether the page should create or describe the file, or whether it is a stated prerequisite
A name comes from elsewhere or has been elided depends-on-context Check page order and make the dependency or omission clear
A package was not installed by the page missing-install-step Review the hint against the page's stated prerequisites
A timeout, runtime error or some external network results occur timeout, runtime-error or network-external Investigate the environment and evidence before deciding whether the docs need a fix
A tool or supported execution feature is absent missing-tool, host-tool, runner-gap or unsupported-syntax Record the coverage gap and use an appropriate separate check

The first four rows are docs-bug categories. Other results can still reveal a problem after human review. For example, a missing fixture is not automatically filed as a docs bug, but a page that expects an unexplained file may need better instructions. An external network failure may be transient, or it may reveal a broken documented address; reproduce it before assigning the cause.

Intentional output blocks, alternative tabs and marked fragments can be skipped with reasons such as output-block, alt-variant and fragment. Unsupported or non-executable material can also be skipped. Review those skips as coverage decisions. A report with no likely docs bugs and many skipped blocks does not establish that the entire site works.

For a concrete example of why classification matters, a published run on an open-source AI SDK documentation site extracted 1,327 blocks across 261 pages. It planned 927 for testing, recorded 520 failures and flagged 7 of those failures as likely docs bugs. Those counts describe that particular run, not an expected rate for another project.

Fit the workflow to the project

Solo maintainer

Keep a short list of paths that must work for a new reader: the README, installation and first operation. Run the relevant checks when those pages or the public API change, and inspect a scheduled report at a regular maintenance opportunity. Record known credential and platform gaps in the repository so they do not need to be rediscovered on every contribution.

For a release, check the package a reader can install and update any version-specific instructions. If a finding needs a platform or service the maintainer cannot access, ask a contributor with that environment for a reproducible result. Keep that request specific: include the page, version, expected behavior and steps already attempted.

Small team

Give each important path an owner and agree on what blocks a pull request. A clear API mismatch in a complete example may need a fix before merge; an external timeout may need investigation without assigning blame to the contributor. Review recurring skips as a group and decide which deserve a dedicated test or better prerequisites.

Use contribution guidance and code ownership to route changes. Coordinate release notes, migration instructions and examples with the public API change rather than treating documentation as a separate cleanup task. Keep a record of which checks use the checkout and which use the published package.

Foundation-scale project

Use a shared baseline for fence labels, prerequisites, credentials and result classification, while allowing individual components to own their supported environments. Assign documentation paths to teams with the knowledge and access to review them. Track coverage by component, release line and reader journey so that an aggregate green result does not hide an untested area.

Separate the people who operate a shared checking system from the maintainers who decide whether a result is a documentation bug. Give both groups enough evidence to reproduce findings. For supported platforms, plan explicit runs for the relevant operating systems and shells; a single Linux run cannot establish behavior everywhere.

Where DocsAlive fits

DocsAlive can take a local checkout, a public Git URL or a connected source and detect supported documentation formats, including plain Markdown and MDX. It extracts fenced blocks, plans whether to execute, syntax-check or skip them, and records the reason. It keeps blocks in page order, selects one alternative from a tab group and runs pages in fresh containers. Its reports include findings with page and line information, status, category and reason. See the framework reference and CLI reference for the supported paths and options.

Python and JavaScript examples can be executed within the supported runner. Simple TypeScript type annotations are stripped before execution; other TypeScript-only syntax is not judged, and JSX and TSX are not judged yet. Compiled languages are recognized but not executed. Credential-gated examples are classified rather than executed with real keys; running them with customer-provided test credentials is not currently supported.

For expected output, the product compares printed output line by line for pycon sessions. Design other checks according to what they actually verify, and keep a separate authorized integration test for behavior that needs a real credential or service.

Open source plan and health check

The Open source plan is $0/month for eligible public open-source projects. The repository and docs must be public under an OSI-approved license; private and commercial closed-source docs are not eligible. It covers one public repository and up to 100 docs pages, with weekly scheduled runs, check annotations and a report, a docs health badge, OpenAPI reference checks, Markdown and JSON reports, and best-effort community support without an SLA.

The plan does not include pull-request checks or draft fix PRs. Paid plans with those capabilities start at Team; see pricing. To apply for OSS access, tell the team about the project through the contact page. Access and timing are not guaranteed.

For a one-off assessment, the health check accepts a public GitHub or GitLab repository you own, maintain or are authorized to test. The team runs the engine on up to 40 docs pages and emails the real report within two business days. The checkout is deleted after the run. Use the report to choose a starting set of fixes and identify examples that need a separate test.

Read structured-data results carefully

Structured examples have different limits from executable programs. JSON fences are parsed using Python's JSON parser. That parser accepts NaN, Infinity and -Infinity, and keeps the last value for repeated keys, so a passing result does not establish strict JSON compliance. JSON blocks with comments or ellipsis placeholders are skipped as illustrative; jsonc and json5 blocks are skipped rather than parsed.

TOML fences are checked with Python 3.12's tomllib, which supports TOML 1.0.0. Syntax that is valid only in TOML 1.1.0 could fail that check. YAML fences are not parsed by the runner: a green result with the detail yaml parser not in image; skipped is not a YAML syntax check. Use yamllint or a YAML parser in your own CI for those blocks.

Structured blocks are parsed rather than checked against a schema, so a passing result does not establish that a configuration key exists in the current version of a tool. Review the report's reason and use a tool-specific validation step when the configuration itself is part of the promise.

Pasteable maintainer checklist

Copy this list into a release issue or pull request template and adapt the paths to the project:

  • [ ] Identify the README, installation and first-use examples affected by the change.
  • [ ] Record the package or binary version, operating system, shell and runtime being tested.
  • [ ] Run complete examples in page order from a clean starting environment.
  • [ ] Check that required installs, files and other prerequisites are documented.
  • [ ] Mark intentional fragments and label code, interactive sessions and output honestly.
  • [ ] Use placeholders for keys and record which credential-gated steps were not run.
  • [ ] Check relevant examples when a pull request changes docs or a public API.
  • [ ] Review fork workflow changes before approving a run that requires approval.
  • [ ] Test the release candidate, then repeat important paths against the published package.
  • [ ] Review scheduled results and confirm the workflow remains enabled.
  • [ ] Triage failures by cause; investigate uncertain and external failures before assigning them.
  • [ ] Record skipped languages, alternative tabs, platforms and fixtures as coverage gaps.
  • [ ] Assign a maintainer or team to follow up on actionable findings.

For a broader version, see the docs testing checklist and the guide to free docs testing tools.

The sources we checked

These sources were read on November 11, 2026. Product details come from the supplied product facts checked against the site and deployed engine.

Source What it covers
GitHub Docs: Events that trigger workflows Pull request events, fork restrictions and scheduled workflows
GitHub Docs: Secure use reference Untrusted input, privileged triggers and untrusted checkouts
GitHub Docs: Disabling and enabling a workflow Scheduled workflow disabling and re-enabling
GitHub Docs: Approving workflow runs from forks Approval settings and maintainer review of fork workflow runs
GitHub Docs: About code owners Ownership, review requests and access requirements
GitHub Docs: Setting guidelines for repository contributors Contribution guideline placement and discoverability
Open Source Initiative: Licenses OSI-approved licenses
Python documentation: doctest Testing interactive Python sessions and expected output

FAQ

Which open-source documentation should we test first?

Start with the README, installation instructions and the first successful operation a new reader follows. Add examples affected by public API changes and record the versions, environments and prerequisites each path assumes.

Should forked pull requests run documentation code?

They can run checks designed for untrusted contributions. Use appropriate read-only permissions, do not depend on project secrets, and review proposed workflow changes before approving a run that requires approval. Avoid executing an untrusted checkout in a privileged workflow.

Why test against the published package?

A checkout may contain an API or file that has not shipped. Testing the published package checks the installation path available to readers and can reveal packaging or version mismatches that a checkout test does not.

Does every failed example mean the documentation has a bug?

No. A failure may involve an intentional fragment, a missing fixture, credentials, an external service or a limitation of the runner. Review the category, evidence and documented prerequisites before deciding what to fix.

What does the Open source plan include?

Eligible public projects get one public repository, up to 100 docs pages, weekly runs, annotations and a report, a docs health badge, OpenAPI reference checks, Markdown and JSON reports, and best-effort community support without an SLA. Pull-request checks and draft fix PRs start at Team.

Can DocsAlive test every example?

No. Compiled languages are not executed, TypeScript support is limited, and credential-gated examples are classified rather than run with real keys. Check the report for skips and use separate tests for the environments and flows it does not cover.

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 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 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.